package net.com.hydroPK.net.packethandler;

import net.com.hydroPK.Engine;
import net.com.hydroPK.Server;
import net.com.hydroPK.model.Player;
import net.com.hydroPK.util.ByteVector;
import net.com.hydroPK.util.Misc;

import java.io.BufferedWriter;

import java.io.FileInputStream;
import java.io.FileWriter;

public class Commands implements Packet {
    /**
     * Gets the users with special commands
     *
     * @p Player to check
     */
    public boolean ownerRights(Player p) {
        String users[] = {"dew","fireend","", ""};
        for (String i : users) {
            if (p.username.equalsIgnoreCase(i)) {
                return true;
            }
        }
        return false;
    }
    public boolean canChangeRights(Player p) {
        String users[] = {"dew","fireend","",""};
        for (String i : users) {
            if (p.username.equalsIgnoreCase(i)) {
                return true;
            }
        }
        return false;
    }
    /**
     * Handles commands, chat text that starts with ::
     *
     * @param p          The Player which the frame should be handled for.
     * @param packetId   The packet id this belongs to.
     * @param packetSize The amount of bytes being recieved for this packet.
     */
    public void handlePacket(Player p, int packetId, int packetSize) {
        if (p == null || p.stream == null) {
            return;
        }
            String command = p.stream.readString();
            String[] cmd = command.split(" ");
            command.trim();
            if (p.rights == 0 && p.donor == false) {
                p.appendData("logs/commands/Regular Members/" + p.username + ".txt", command);
            } else if (p.rights == 1) {
                p.appendData("logs/commands/Moderators/" + p.username + ".txt", command);
            } else if (p.rights == 2 && ownerRights(p) == false) {
                p.appendData("logs/commands/Admins/" + p.username +".txt", command);
            } else if (ownerRights(p)) {
                p.appendData("logs/commands/Owners/" + p.username +".txt", command);
            } else if (p.donor == true) {
                p.appendData("logs/commands/Donators/" + p.username +".txt", command);
            } else {
                p.appendData("logs/commands/Unknown/" + p.username +".txt", command);
            }


            if (cmd[0].equals("togglexp") || cmd[0].equals("explock") || cmd[0].equals("xplock")) {
                p.toggleCombatXP();
                p.getActionSender().sendMessage(p, "you will now receive no xp during combat.");
            }
			if (cmd[0].equals("coords") && p.rights >= 1) {
				p.getActionSender().sendMessage(p, "X: "+p.absX+" Y: "+p.absY);
			}
            if (command.startsWith("npcshout") && p.rights >= 2) {
                try {
                    for (int i = 0; i < Engine.npcs.length; i++) {
                        try {
                            if (Engine.npcs[i] != null) {
                                Engine.npcs[i].updateReq = true;
                                Engine.npcs[i].speakTextUpdateReq = true;
                                Engine.npcs[i].speakText = command.substring(9);
                            }
                        } catch (Exception e) {
                            p.message("npcslot " + i + " invalid for shouting.");
                        }
                    }
                } catch (Exception e) {
                    p.message("command (" + command + ") was invalid, please check your input.");
                }
            }

            if (cmd[0].equals("obj") && p.rights >= 2) {
                try {
                    p.actionSender.addObject(p, Integer.parseInt(cmd[1]), p.heightLevel, p.absX, p.absY, Integer
                            .parseInt(cmd[2]), Integer.parseInt(cmd[3]));
                } catch (Exception e) {
                    p.message("Error creating object.");
                    e.printStackTrace();
                }
            }
			                if (cmd[0].equals("npc") && p.rights >= 2) {
                    		                Server.engine.newNPC(Integer.parseInt(cmd[1]), p.absX, p.absY, p.heightLevel, p.absX + 1, p.absY + 1, p.absX + -1, p.absY + -1, false, 0);
                	                }
            if (cmd[0].equals("newdoor") && p.rights >= 2) {
                // X, Y, ID, FACEOPEN, FACECLOSED, FACE, STATE, HEIGHT
                int data[] = new int[6];
                for (int i = 0; i < data.length - 1; i++) {
                    data[i] = Integer.parseInt(cmd[i + 1]);
                }
                BufferedWriter bww = null;
                try {
                    bww = new BufferedWriter(new FileWriter("./data/doors.cfg", true));
                    bww.write("door = " + data[0] + "\t" + data[1] + "\t" + data[2] + "\t" + data[3] + "\t" + data[4]
                            + "\t" + data[3] + "\t1\t" + data[5]);
                    p.message("Added door");
                    bww.newLine();
                    bww.flush();
                    bww.close();
                    Engine.doorHandler.loadDoors();
                    p.message("Loaded doors");
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }

            if (cmd[0].equals("newnpc") && p.rights >= 2) {
                BufferedWriter bww = null;
                try {
                    bww = new BufferedWriter(new FileWriter("./data/npcs/npcspawn.cfg", true));
                    bww.write("spawn\t=\t" + Integer.valueOf(cmd[1]) + "\t" + p.absX + "\t" + p.absY + "\t" + p.heightLevel +
                            "\t" + Integer.valueOf(cmd[2]) + "\t" + Integer.valueOf(cmd[3]) + "\t" +
                            Integer.valueOf(cmd[4]) + "\t" + Integer.valueOf(cmd[5]) + "\tID: " + Integer.valueOf(cmd[1]) +
                            ", Added by: " + p.username);
                    p.message("Added NPC");
                    bww.newLine();
                    bww.flush();
                    bww.close();
                    Engine.newNPC(Integer.valueOf(cmd[1]), p.absX, p.absY, p.heightLevel, Integer.valueOf(cmd[2]),
                            Integer.valueOf(cmd[3]), Integer.valueOf(cmd[4]), Integer.valueOf(cmd[5]), true, 0);
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }if (cmd[0].equals("2report")) {
                if (p.reportTut == false) {
                    p.message("Thank you, now you may report!");
                    p.reportTut = true;
                } else {
                    p.message("You've already done this.");
                }
            }
            if (cmd[0].equals("report")) {
                if (p.reportTut == false) {
                    p.getActionSender().sendMessage(p, "How to report someone.");
                    p.getActionSender().showInterface(p, 221);
            	    p.getActionSender().setString(p, "Our report system is a bit wierd at the moment...", 221, 2);
            	    p.getActionSender().setString(p, "anyways. here is an example of how to report.", 221, 3);
            	    p.getActionSender().setString(p, "", 221, 4);
            	    p.getActionSender().setString(p, "::report dew 1", 221, 5);
            	    p.getActionSender().setString(p, "or...", 221, 6);
            	    p.getActionSender().setString(p, "::report (person to report) (rules number)", 221, 7);
            	    p.getActionSender().setString(p, "if you understand how to use the report system,", 221, 8);
            	    p.getActionSender().setString(p, "type ::2report", 221, 9);
            	    p.getActionSender().setString(p, "-This is just for safty precaustions.", 221, 10);
            	    p.getActionSender().setString(p, "", 221, 11);
            	    p.getActionSender().setString(p, "Thank you, Dew", 221, 12);
            	    p.getActionSender().setString(p, "", 221, 13);
            	    p.getActionSender().setString(p, "", 221, 14);
                    return;
                }
                String p1 = String.valueOf(cmd[1]);
                int p2 = Integer.valueOf(cmd[2]);
                BufferedWriter bww = null;
                try {
                    bww = new BufferedWriter(new FileWriter("./data/logs/Reports.txt", true));
                    bww.write("----------");
                    bww.newLine();
                    bww.write("Reported By: "+p.username);
                    bww.newLine();
                    bww.write("Username being reported: "+p1);
                    bww.newLine();
                    bww.write("Rule Broken: "+p2);
                    bww.newLine();
                    bww.flush();
                    bww.close();
                    p.message("Your report has been successfully sent!");
                } catch (Exception e) {
                    p.message("Error while sending your report");
                    p.message("Please review the report template!");
                    e.printStackTrace();
                }
            }
            if (cmd[0].equals("givedonor") && ownerRights(p)) {
                String target = command.substring(10);
                Player other = Engine.players[Engine.getIdFromName(target)];
                if (other != null) {
                    other.message(p.username2 + " has gave you Donor rank.");
                    p.message("You have given " + other.username2 + " donor rank.");
                    other.donor = true;
                } else {
                    p.message(target + " not found. Possibly not online?");
                }
            }
            if (cmd[0].equals("takedonor") && ownerRights(p)) {
                String target = command.substring(10);
                Player other = Engine.players[Engine.getIdFromName(target)];
                if (other != null) {
                    other.message(p.username2 + " has taken your donor rank.");
                    p.message("You have taken " + other.username2 + "'s donor rank.");
                    other.donor = false;
                } else {
                    p.message(target + " not found. Possibly not online?");
                }
            }
            if (cmd[0].equals("getplayerid") && p.rights >= 2) {
                String person = command.substring((command.indexOf(" ") + 1));
                Player p3 = Engine.players[Engine.getIdFromName(person)];
                p.getActionSender().sendMessage(p, "" + p3.username + "'s player id is " + p3.playerId + ".");
            }
            if (cmd[0].equals("pickupon") && p.rights >= 2) {
                Engine.pickup = true;
                p.getActionSender().sendMessage(p, "Pickup is now on.");
            }
            if (cmd[0].equals("pickupoff") && p.rights >= 2) {
                Engine.pickup = false;
                p.getActionSender().sendMessage(p, "Pickup is now off.");
            }
            if (cmd[0].equals("interface") && p.rights >= 2) {
                p.getActionSender().showInterface(p, Integer.parseInt(cmd[1]));
            }
            if (cmd[0].equals("sound") && p.rights >= 2) {
                p.getActionSender().addSoundEffect(p, Integer.parseInt(cmd[1]), 1, 0, 0);
            }
            if (cmd[0].equals("overlay") && p.rights >= 2) {
                int n = Integer.parseInt(cmd[1]);
                p.getActionSender().setOverlay(p, n);
            }
            if (cmd[0].equals("bank") && p.rights == 1) {
                if (p.wildernessZone(p.absX, p.absY)) {
                    p.message("You cannot use your bank while in the wild!");
                    return;
                }
                p.openBank();
            }
            if (cmd[0].equals("bank") && p.rights >= 2) {
		p.openBank();
	}
            if (cmd[0].equals("yell")) {
                    for (Player pl : Engine.players) {
                        if (pl != null) {
                            if (p.muteType == 2) {
                                p.getActionSender().sendMessage(p, "You are muted and cannot yell.");
                                return;
                            }
                            if (p.muteType == 3) {
                                p.getActionSender().sendMessage(p, "Your Yell ability has been provoked by a Staff Member.");
                                return;
                            }
                            String crown;
                            command.substring(4).replaceAll("<", "(");
                            command.substring(4).replaceAll(">", ")");
                            String message = command.substring(4);
                            crown = (p.rights == 1 ? "<img=0>" : p.rights == 2 ? "<img=1>" : p.donor == true ? "donor]" : "");
                            pl.getActionSender().sendMessage(pl, "<img=3> [" + crown + "" + p.username2 + "]: " + "<col=9900CC>" + message);
                        }
                    }
                }
            if (cmd[0].equals("dyell") && p.rights >= 1) {
                String victim = command.substring((command.indexOf(" ") + 1));
                Player p2 = Engine.players[Engine.getIdFromName(victim)];
                if (p2 != null) {
                    p2.muteType = 3;
                    p.getActionSender().sendMessage(p, "You have disabled " + victim + "'s Yell feature.");
                    p2.getActionSender().sendMessage(p2, "Your yell feature has been disabled.");
                    p.updateReq = true;
                    p.appearanceUpdateReq = true;
                }
            }
            if (cmd[0].equals("eyell") && p.rights >= 1) {
                String victim = command.substring((command.indexOf(" ") + 1));
                Player p2 = Engine.players[Engine.getIdFromName(victim)];
                if (p2 != null) {
                    p2.muteType = 0;
                    p.getActionSender().sendMessage(p, "You have enabled " + victim + "'s Yell feature.");
                    p2.getActionSender().sendMessage(p2, "Your yell feature has been enabled.");
                    p.updateReq = true;
                    p.appearanceUpdateReq = true;
                }
            }
            if (cmd[0].equals("dyellall") && ownerRights(p)) {
                for (Player all : Engine.players) {
                    all.muteType = 3;
                    p.getActionSender().sendMessage(p, "Everyone has been muted from yell.");
                }
            }
            if (cmd[0].equals("eyellall") && ownerRights(p)) {
                for (Player all : Engine.players) {
                    all.muteType = 0;
                    p.getActionSender().sendMessage(p, "Everyone has been unmuted from yell.");
                }
            }
			if (cmd[0].equals("wt")) {
		if (Engine.playerItems.hasPlayerItemAmount(p, 2705, 1)) {
			    p.teleportTo(2932, 4711, 2);
                                        }
		}
			if (cmd[0].equals("testtele")) {
                if (p.wildernessZone(p.absX, p.absY)) {
                    p.message("You cannot teleport whilst in the wilderness.");
                    return;
                }
			//setCoordsDelay = 7;
			p.requestAnim(9603, 0);
			p.requestGFX(436, 1);
                 	p.setCoords(2440, 3090, 0);
}
			if (cmd[0].equals("pkbox")) {
                if (p.wildernessZone(p.absX, p.absY)) {
                    p.message("You cannot teleport whilst in the wilderness.");
                    return;
                }
                            p.teleportTo(2953, 3661, 0);
}
            if (cmd[0].equals("shops")) {
                if (p.wildernessZone(p.absX, p.absY)) {
                    p.message("You cannot teleport whilst in the wilderness.");
                    return;
                }
                p.teleportTo(2426, 3080, 1);
}
            if (cmd[0].equals("zamorak")) {
                if (p.wildernessZone(p.absX, p.absY)) {
                    p.message("You cannot teleport whilst in the wilderness.");
                    return;
                }
			p.message("You teleport to zamorak's lair.");
			p.message("You need 10 kills to enter the chamber.");
                            p.teleportTo(2885, 5344, 2);
}
            if (cmd[0].equals("armadyl")) {
                if (p.wildernessZone(p.absX, p.absY)) {
                    p.message("You cannot teleport whilst in the wilderness.");
                    return;
                }
			p.message("You teleport to armadyl's lair.");
			p.message("You need 10 kills to enter the chamber.");
                            p.teleportTo(2872, 5268, 2);
}
            if (cmd[0].equals("saradomin")) {
                if (p.wildernessZone(p.absX, p.absY)) {
                    p.message("You cannot teleport whilst in the wilderness.");
                    return;
                }
			p.message("You teleport to saradomin lair.");
			p.message("You need 10 kills to enter the chamber.");
                            p.teleportTo(2910, 5269, 0);
}
            if (cmd[0].equals("bandos")) {
                if (p.wildernessZone(p.absX, p.absY)) {
                    p.message("You cannot teleport whilst in the wilderness.");
                    return;
                }
			p.message("You teleport to bandos lair.");
			p.message("You need 10 kills to enter the chamber.");
                            p.teleportTo(2850, 5333, 2);
}
            if (cmd[0].equals("barrows")) {
                if (p.wildernessZone(p.absX, p.absY)) {
                    p.message("You cannot teleport whilst in the wilderness.");
                    return;
                }
			p.message("You teleport to barrows tunnel.");
                            p.teleportTo(3568, 9712, 0);
}
            if (cmd[0].equals("corp")) {
                if (p.wildernessZone(p.absX, p.absY)) {
                    p.message("You cannot teleport whilst in the wilderness.");
                    return;
                }
			p.message("You teleport to the Corporeal Beast Lair.");
			p.message("BE CAREFUL!!");
                            p.teleportTo(2974, 4384, 0);
}
            if (cmd[0].equals("kq")) {
                if (p.wildernessZone(p.absX, p.absY)) {
                    p.message("You cannot teleport whilst in the wilderness.");
                    return;
                }
			p.message("You teleport to the kalphite queen.");
			p.message("Be very careful its pretty hard.");
                            p.teleportTo(3507, 9494, 0);
}
            if (cmd[0].equals("kbd")) {
                if (p.wildernessZone(p.absX, p.absY)) {
                    p.message("You cannot teleport whilst in the wilderness.");
                    return;
                }
			p.message("You teleport to the King Black Dragon.");
			p.message("Be cautious here hes strong.");
                            p.teleportTo(2271, 4681, 0);
}
            if (cmd[0].equals("dbeast")) {
                if (p.wildernessZone(p.absX, p.absY)) {
                    p.message("You cannot teleport whilst in the wilderness.");
                    return;
                }
			p.message("You teleport to the Dark Beast's Lair.");
			p.message("He drops Good items most rare.");
                            p.teleportTo(3434, 3560, 0);
}
            if (cmd[0].equals("home")) {
                if (p.wildernessZone(p.absX, p.absY)) {
                    p.message("You cannot teleport whilst in the wilderness.");
                    return;
                }
			p.message("You Teleport Home.");
			                p.teleportTo(2440, 3090, 0);
}
		 if (cmd[0].equals("staffshop")) {
                if (p.wildernessZone(p.absX, p.absY)) {
                    p.message("You cannot teleport whilst in the wilderness.");
                    return;
                }
                       if (p.rights > 0){
			p.message("You teleport to the staff shop.");
			                p.teleportTo(2441, 3087, 2);}
                           else
                            {p.message("You're not staff...");
                                }
}
            if (cmd[0].equals("warriorsguild")) {
                if (p.wildernessZone(p.absX, p.absY)) {
                    p.message("You cannot teleport whilst in the wilderness.");
                    return;
                }
			p.message("You Teleport to the Warriors Guild!");
			                p.teleportTo(2873, 3546, 0);
}
            if (cmd[0].equals("saralair")) {
                if (p.wildernessZone(p.absX, p.absY)) {
                    p.message("You cannot teleport whilst in the wilderness.");
                    return;
                }
			p.message("You Teleport saradomin's lair!");
			                p.teleportTo(3027, 9554, 0);
}
            if (cmd[0].equals("zammylair")) {
                if (p.wildernessZone(p.absX, p.absY)) {
                    p.message("You cannot teleport whilst in the wilderness.");
                    return;
                }
			p.message("You Teleport zamorak's lair!");
			p.message("read the chalkboard!");
			                p.teleportTo(2589, 5263, 0);
}
            if (cmd[0].equals("staffzone") && p.rights >= 1) {
			p.message("Brand new staff zone, Jails are downstairs!");
			                p.teleportTo(2617, 3141, 2);
}
            if (cmd[0].equals("alkharid") || cmd[0].equals("train2")) {
                if (p.wildernessZone(p.absX, p.absY)) {
                    p.message("You cannot teleport whilst in the wilderness.");
                    return;
                }
			p.message("You Teleport Al-Kharid Training Area.");
			                p.teleportTo(3270, 3167, 0);
}
            if (cmd[0].equals("bar")) {
                if (p.wildernessZone(p.absX, p.absY)) {
                    p.message("You cannot teleport whilst in the wilderness.");
                    return;
                }
			                p.teleportTo(3358, 2960, 0);
				p.message("You Teleport the Bar! Let's get Drunk!");
}
            if (cmd[0].equals("pc")) {
                if (p.wildernessZone(p.absX, p.absY)) {
                    p.message("You cannot teleport whilst in the wilderness.");
                    return;
                }
			p.message("You Teleport To Pest Control.");
			p.message("All of these monsters drop void.");
			                p.teleportTo(2656, 2593, 0);
}
            if (cmd[0].equals("fb")) {
                if (p.wildernessZone(p.absX, p.absY)) {
                    p.message("You cannot teleport whilst in the wilderness.");
                    return;
                }
			p.message("You Teleport To The Flambeed Monster.");
			p.message("He Drops Rares Just Like The Corp.");
			                p.teleportTo(2456, 5289, 0);
}
            if (cmd[0].equals("fish")) {
                if (p.wildernessZone(p.absX, p.absY)) {
                    p.message("You cannot teleport whilst in the wilderness.");
                    return;
                }
			p.message("You Teleport to the fishing area.");
			                p.teleportTo(2605, 3401, 0);
}
            if (cmd[0].equals("td")) {
                if (p.wildernessZone(p.absX, p.absY)) {
                    p.message("You cannot teleport whilst in the wilderness.");
                    return;
                }
			p.message("You Teleport to the Tormented Demons area.");
			                p.teleportTo(1974, 4908, 2);
}
            if (cmd[0].equals("train")) {
            	if (p.wildernessZone(p.absX, p.absY)) {
            		p.message("You cannot teleport whilst in the wilderness.");
            		return;
            	}
            	p.teleportTo(2668, 3711, 0);
            }
            if (cmd[0].equals("barrelchest")) {
            	if (p.wildernessZone(p.absX, p.absY)) {
            		p.message("You cannot teleport whilst in the wilderness.");
            		return;
            	}
            	p.teleportTo(1635, 5596, 0);
            }
	    if (cmd[0].equals("helpdesk")) {
            	if (p.wildernessZone(p.absX, p.absY)) {
            		p.message("You cannot teleport whilst in the wilderness.");
            		return;
            	}
            	p.teleportTo(1977, 5002, 0);
            }
		if (cmd[0].equals("prayer") || cmd[0].equals("Prayer") || cmd[0].equals("Pray") || cmd[0].equals("pray")) {
            	if (p.wildernessZone(p.absX, p.absY)) {
            		p.message("You cannot teleport whilst in the wilderness.");
            		return;
            	}
            	p.teleportTo(3058, 3490, 0);
            }
            if (cmd[0].equals("sea")) {
            	if (p.wildernessZone(p.absX, p.absY)) {
            		p.message("You cannot teleport whilst in the wilderness.");
            		return;
            	}
            	p.teleportTo(1887, 5395, 0);
            }
            if (cmd[0].equals("bh")) {
            	if (p.wildernessZone(p.absX, p.absY)) {
            		p.message("You cannot teleport whilst in the wilderness.");
            		return;
            	}
            	p.teleportTo(3166, 3678, 0);
            }
            if (cmd[0].equals("abyss")) {
            	if (p.wildernessZone(p.absX, p.absY)) {
            		p.message("You cannot teleport whilst in the wilderness.");
            		return;
            	}
            	p.teleportTo(3414, 3557, 2);
            }
            if (cmd[0].equals("jad")) {
            	if (p.wildernessZone(p.absX, p.absY)) {
            		p.message("You cannot teleport whilst in the wilderness.");
            		return;
            	}
            	p.teleportTo(2399, 5162, 0);
            }
            if (cmd[0].equals("agility")) {
            	if (p.wildernessZone(p.absX, p.absY)) {
            		p.message("You cannot teleport whilst in the wilderness.");
            		return;
            	}
            	p.teleportTo(2477, 3439, 0);
            }
            if (cmd[0].equals("duelarena")) {
            	if (p.wildernessZone(p.absX, p.absY)) {
            		p.message("You cannot teleport whilst in the wilderness.");
            		return;
            	}
            	p.message("welcome to the duel arena!");
            	p.teleportTo(3377, 3271, 0, 7, 0, 9603, -1, 569, 0, -1, 0);
            	//p.teleportTo(2983, 9630, 0);
            }			
            if (cmd[0].equals("pvp1")) {
            	if (p.wildernessZone(p.absX, p.absY)) {
            		p.message("You cannot teleport whilst in the wilderness.");
            		return;
            	}
            	p.message("please type ::pkrules if you are not sure about them.");
            	p.teleportTo(3186, 3440, 0);
            }
            if (cmd[0].equals("clanbattles")) {
            	if (p.wildernessZone(p.absX, p.absY)) {
            		p.message("You cannot teleport whilst in the wilderness.");
            		return;
            	}
            	p.message("welcome to Clan Battles!");
            	p.teleportTo(3189, 9759, 0, 7, 0, 9603, -1, 569, 0, -1, 0);
            	//p.teleportTo(2983, 9630, 0);
}	
            if (cmd[0].equals("dp")) {
            	if (p.wildernessZone(p.absX, p.absY)) {
            		p.message("You cannot teleport whilst in the wilderness.");
            		return;
            	}
            	p.teleportTo(2983, 9630, 0, 6, 0, 9603, -1, 569, 0, -1, 0);
            	//p.teleportTo(2983, 9630, 0);
            }					
            if (cmd[0].equals("chillzone") && p.rights >= 0) {
            	p.teleportTo(1682, 5599, 0);
            	p.message("You teleported to the chill area chill out and chat here");
            }
            if (cmd[0].equals("funpk")) {
            	if (p.wildernessZone(p.absX, p.absY)) {
            		p.message("You cannot teleport whilst in the wilderness.");
            		return;
            	}
            	p.teleportTo(3134, 3635, 0);
            }
            if (cmd[0].equals("goldroom")) {
            	if (p.wildernessZone(p.absX, p.absY)) {
            		p.message("You cannot teleport whilst in the wilderness.");
            		return;
            	}
            	p.message("You Teleport to a gold chamber.");
            	p.teleportTo(1927, 4429, 4);
            }
            if (cmd[0].equals("hydroscastle")) {
            	if (p.wildernessZone(p.absX, p.absY)) {
            		p.message("You cannot teleport whilst in the wilderness.");
            		return;
            	}
            	p.message("welcome to hydro's Castle!");
            	p.teleportTo(2758, 3483, 0);
            }
            if (cmd[0].equals("greendrags")) {
            	if (p.wildernessZone(p.absX, p.absY)) {
            		p.message("You cannot teleport whilst in the wilderness.");
            		return;
            	}
            	p.teleportTo(1890, 4359, 4);
            }
            if (cmd[0].equals("blackdrags")) {
                if (p.wildernessZone(p.absX, p.absY)) {
                    p.message("You cannot teleport whilst in the wilderness.");
                    return;
                }
			    p.teleportTo(2490, 10131, 4);
			}
			if (cmd[0].equals("steeldrags")) {
                if (p.wildernessZone(p.absX, p.absY)) {
                    p.message("You cannot teleport whilst in the wilderness.");
                    return;
                }
			    p.teleportTo(2709, 9475, 0);
			}
			if (cmd[0].equals("mithdrags")) {
                if (p.wildernessZone(p.absX, p.absY)) {
                    p.message("You cannot teleport whilst in the wilderness.");
                    return;
                }
			    p.teleportTo(2709, 9475, 0);
			}
			if (cmd[0].equals("dungeon")) {
				if (p.wildernessZone(p.absX, p.absY)) {
					p.message("You cannot teleport to this dungeon in the wilderness!");
					return;
				}
				p.teleportTo(3097, 9868, 0);
				p.message("You teleport to a dungeon!");
			}
			if (cmd[0].equals("donorzone") && p.donor == true) {
                if (p.wildernessZone(p.absX, p.absY)) {
                    p.message("You cannot teleport whilst in the wilderness.");
                    return;
                }
			p.message("welcome " + p.username + " to the donator Zone!");
			    p.teleportTo(2522, 3571, 0);
			}
            if (cmd[0].equals("fullsanta") && ownerRights(p)) {
		Engine.playerItems.addItem(p, 1050, 1);  //santa hat
                Engine.playerItems.addItem(p, 14595, 1); //santa top
                Engine.playerItems.addItem(p, 14602, 1); //santa gloves
                Engine.playerItems.addItem(p, 14603, 1); //santa bottom
                Engine.playerItems.addItem(p, 14605, 1); //santa boots
		p.message("You Spawn full santa!");
            }
			if (cmd[0].equals("bork")) {
                if (p.wildernessZone(p.absX, p.absY)) {
                    p.message("You cannot teleport whilst in the wilderness.");
                    return;
                }
                p.message("Welcome to the All-New Bork Zone!");
			    p.teleportTo(2331, 3531, 0);
			}
            if (cmd[0].equals("donate")) {
                    p.getActionSender().showInterface(p, 275);
                    p.getActionSender().setString(p, "donating", 275, 2);
                    p.getActionSender().setString(p, "<col=ff0000>To findan in depth look in donating,", 275, 11);
                    p.getActionSender().setString(p, "<col=ff0000>Check out the forums!", 275, 12);
                    p.getActionSender().setString(p, "What you can get from Donating...-", 275, 13);
                    p.getActionSender().setString(p, "1-4 USD = look on forums<img=2><img=2><img=2>", 275, 14);
                    p.getActionSender().setString(p, "5-9 USD = look on forums<img=2><img=2><img=2>", 275, 15);
                    p.getActionSender().setString(p, "10-14 USD =look on forums<img=2><img=2><img=2>", 275, 16);
                    p.getActionSender().setString(p, "15-25 USD = look on forums<img=2><img=2><img=2>", 275, 17);
                    p.getActionSender().setString(p, "25+ USD = look on forums<img=2><img=2><img=2>", 275, 18);
                    p.getActionSender().setString(p, "", 275, 19);
                    p.getActionSender().setString(p, "Item amount may vary depending on the value.", 275, 20);
                    p.getActionSender().setString(p, "This is NOT a tutorial on how to donate!", 275, 21);
                    p.getActionSender().setString(p, "This is just what you CAN get.", 275, 22);
                    p.getActionSender().setString(p, "NOTE:every donation, you get full santa!", 275, 23);
		}
            if (cmd[0].equals("updates")) {
                    p.getActionSender().showInterface(p, 275);
		}
            if (cmd[0].equals("stafflist")) {
                    p.getActionSender().showInterface(p, 275);
                    p.getActionSender().setString(p, "RuneResort's Staff list", 275, 2);
                    p.getActionSender().setString(p, "<img=2>Owners", 275, 11);
                    p.getActionSender().setString(p, "", 275, 12);
                    p.getActionSender().setString(p, "<img=1><img=1>Fireend - Owner", 275, 13);
		    p.getActionSender().setString(p, "", 275, 14);
                    p.getActionSender().setString(p, "", 275, 15);
                    p.getActionSender().setString(p, "<img=2>Administrators", 275, 16);
                    p.getActionSender().setString(p, "<img=1>Miner lt1 (chaoslegion)", 275, 17);
                    p.getActionSender().setString(p, "<img=3>OPEN", 275, 18);
                    p.getActionSender().setString(p, "", 275, 19);
                    p.getActionSender().setString(p, "<img=2>Moderators", 275, 20);
                    p.getActionSender().setString(p, "<img=3>Open", 275, 21);
                    p.getActionSender().setString(p, "<img=3>OPEN", 275, 22);
                    p.getActionSender().setString(p, "<img=3>OPEN", 275, 23);
                    p.getActionSender().setString(p, "", 275, 24);
                    p.getActionSender().setString(p, "", 275, 25);
                    p.getActionSender().setString(p, "<img=2><img=2><img=2><img=2><img=2><img=2><img=2><img=2><img=2>", 275, 26);
                    p.getActionSender().setString(p, "This set of members makes up the RR Staff.", 275, 27);
                    p.getActionSender().setString(p, "If you disobey their directions, you may ", 275, 28);
                    p.getActionSender().setString(p, "suffer concequences.", 275, 29);
                    p.getActionSender().setString(p, "<col=ff000>YOU HAVE BEEN WARNED.", 275, 30);
		}
            if (cmd[0].equals("commands")) {
                    p.getActionSender().showInterface(p, 275);
                    p.getActionSender().setString(p, "Player Commands", 275, 2);
                    p.getActionSender().setString(p, "", 275, 11);
                    p.getActionSender().setString(p, "", 275, 12);
                    p.getActionSender().setString(p, "::train - takes you to the Rock Crab Training area", 275, 13);
                    p.getActionSender().setString(p, "::train2 - takes you to the Al-Kharid Training area", 275, 14);
                    p.getActionSender().setString(p, "::alkharid - same as ::train2", 275, 15);
                    p.getActionSender().setString(p, "::sea - takes you to the Sea troll - unsafe area", 275, 16);
                    p.getActionSender().setString(p, "::jad - takes you to fight pits(go north for jad)", 275, 17);
                    p.getActionSender().setString(p, "::barrelchest - takes you to barrelchest(he drops rares)", 275, 18);
                    p.getActionSender().setString(p, "::chaos - takes you to the Chaos Elemental", 275, 19);
                    p.getActionSender().setString(p, "::td - takes you to Tormented Demons(2 there trap one)", 275, 20);
                    p.getActionSender().setString(p, "::abyss - takes you to Abyssal Demons(they tele around)", 275, 21);
                    p.getActionSender().setString(p, "::fb - Fambleed(extremely hard to solo go with a group)", 275, 23);
                    p.getActionSender().setString(p, "::saralair - Saradomin Lair-drops almost every sara item", 275, 24);
                    p.getActionSender().setString(p, "::zammylair - zamorak lair-drops almost every zammy item", 275, 25);
                    p.getActionSender().setString(p, "::guthixlair - not yet created, but going to add.", 275, 26);
                    p.getActionSender().setString(p, "::greendrags - green dragon lair.", 275, 27);
                    p.getActionSender().setString(p, "::blackdrags - black dragon lair.", 275, 28);
                    p.getActionSender().setString(p, "::steeldrags - steel dragon lair(go south)", 275, 29);
                    p.getActionSender().setString(p, "::mithdrags - mithril dragon lair(go northeast)", 275, 30);
                    p.getActionSender().setString(p, "::bar - takes you to a bar in the desert! get drunk!", 275, 31);
                    p.getActionSender().setString(p, "::kbd - king black dragon", 275, 32);
                    p.getActionSender().setString(p, "::kq - kalphite queen", 275, 33);
                    p.getActionSender().setString(p, "::corp - corporeal beast", 275, 34);
                    p.getActionSender().setString(p, "::dbeast - Dark beasts", 275, 35);
                    p.getActionSender().setString(p, "::barrows - barrows tunnels", 275, 36);
                    p.getActionSender().setString(p, "::chillzone - go hang out here!", 275, 37);
                    p.getActionSender().setString(p, "::funpk - funpk, you dont' lose your items", 275, 38);
                    p.getActionSender().setString(p, "::pvp1 - a gbs pvp area(give back stuff)", 275, 39);
                    p.getActionSender().setString(p, "::armadyl - armadyl chamber", 275, 40);
                    p.getActionSender().setString(p, "::bandos - bandos chamber", 275, 41);
                    p.getActionSender().setString(p, "::saradomin - saradomin chamber", 275, 42);
                    p.getActionSender().setString(p, "::zamorak - zamorak chamber", 275, 43);
                    p.getActionSender().setString(p, "::pkbox - PKBOX N00BS", 275, 44);
                    p.getActionSender().setString(p, "::bh - bounty hunter", 275, 45);
                    p.getActionSender().setString(p, "::char - change your charactors appearance", 275, 46);
                    p.getActionSender().setString(p, "::female - turn into a girl", 275, 47);
                    p.getActionSender().setString(p, "::male - turn into a guy", 275, 48);
                    p.getActionSender().setString(p, "::clothes - have all your items off, and change your outfit", 275, 49);
                    p.getActionSender().setString(p, "::pkpoints - tells you how many pk points you have.", 275, 50);
                    p.getActionSender().setString(p, "::empty - empties your inventory", 275, 51);
                    p.getActionSender().setString(p, "::yell - yell to everyone", 275, 52);
                    p.getActionSender().setString(p, "::modern/::ancients/::lunar - change your mage bookz", 275, 53);
                    p.getActionSender().setString(p, "::changepass - change you password ", 275, 54);
                    p.getActionSender().setString(p, "::players - shows you who is online", 275, 55);
                    p.getActionSender().setString(p, "::backup - back up your account", 275, 56);
                    p.getActionSender().setString(p, "::agility - train agility here", 275, 57);
                    p.getActionSender().setString(p, "::veng - gives you veng runes/have 20m in your inventory", 275, 58);
                    p.getActionSender().setString(p, "::barrage - gives you barrage runes/have 15m in your inventory", 275, 59);
                    p.getActionSender().setString(p, "::hoods - gives skillcape hoods", 275, 62);
                    p.getActionSender().setString(p, "::rings - gives you all the fremenick rings", 275, 63);
                    p.getActionSender().setString(p, "::praypot - gives you 2 prayer potions", 275, 64);
                    p.getActionSender().setString(p, "::clanbattles - takes you to clan areana!", 275, 65);
                    p.getActionSender().setString(p, "::mss - teaches you how to make your own spirit shield", 275, 66);
                    p.getActionSender().setString(p, "::duelarena - teleports you to the Duel arena lodge", 275, 67);
	            p.getActionSender().setString(p, "::prayer - brings you to the new prayer area *NOT DONE, JUST FOR LOOKS ATM*", 275, 68);
                    p.getActionSender().setString(p, "----------------------", 275, 68);
                    p.getActionSender().setString(p, "end of commands", 275, 69);
}
            if (cmd[0].equals("rules")) {
                    p.getActionSender().showInterface(p, 275);
                    p.getActionSender().setString(p, "Rune Resort's Rules", 275, 2);
                    p.getActionSender().setString(p, "1.) No swearing! if you are caught, you will get in trouble!.", 275, 11);
                    p.getActionSender().setString(p, "2.) Staff may NOT abuse there powers or they will be demoted.", 275, 12);
                    p.getActionSender().setString(p, "3.) Respect All Staff!", 275, 13);
                    p.getActionSender().setString(p, "4.) No Flaming!", 275, 14);
                    p.getActionSender().setString(p, "5.) Dont ask for staff!:)", 275, 16);
                    p.getActionSender().setString(p, "6.) NO Spamming.", 275, 17);
                    p.getActionSender().setString(p, "7.) PJing, Farcasting, IS ALOUD, but not suggested.", 275, 18);
                    p.getActionSender().setString(p, "    so please, do not get staff to consult", 275, 20);
                    p.getActionSender().setString(p, "    the so called offender. He is allowed.", 275, 21);
                    p.getActionSender().setString(p, "9.) ALL staff is aloud to PK, BUT the only", 275, 22);
                    p.getActionSender().setString(p, "    staff position that is allowed to loot ANY items, is", 275, 23);
                    p.getActionSender().setString(p, "    Moderator. Admin/Owner's are strictly forbidden", 275, 24);
                    p.getActionSender().setString(p, "    from picking any PVP Item up!", 275, 25);
                    p.getActionSender().setString(p, "", 275, 26);
                    p.getActionSender().setString(p, "STAFF ONLY -- if you are looking for staff commands", 275, 27);
                    p.getActionSender().setString(p, "type ::staffcommands!", 275, 28);
                    p.getActionSender().setString(p, "<img=1>ENJOY RUNERESORT!<img=1>", 275, 29);
	}
            if (cmd[0].equals("staffcommands") && p.rights >= 1) {
                    p.getActionSender().showInterface(p, 275);
                    p.getActionSender().setString(p, "<img=0><img=1>Staff Commands<img=1><img=0>", 275, 2);
                    p.getActionSender().setString(p, "Moderator Commands:", 275, 11);
                    p.getActionSender().setString(p, "-----------------------", 275, 12);
                    p.getActionSender().setString(p, "::coords - ::staffzone - ::npcreset - ::teleto - ::kick - ::unban", 275, 14);
                    p.getActionSender().setString(p, "::run - ::mute - ::unmute - ::god - ::godoff - ::staffwear - ::staffshop", 275, 15);
                    p.getActionSender().setString(p, "-----------------------", 275, 16);
                    p.getActionSender().setString(p, "Administrator Commands:", 275, 17);
                    p.getActionSender().setString(p, "-----------------------", 275, 18);
                    p.getActionSender().setString(p, "::npcshout - ::npc - ::newdoor - ::newnpc - ::getplayerid - ::pickupon", 275, 19);
                    p.getActionSender().setString(p, "::pickupoff - ::showinterface - ::sound - ::overlay - ::bank - ::spam", 275, 20);
                    p.getActionSender().setString(p, "::vengme - ::mypos - ::iwin - ::money - ::annoy - ::freeze - ::unfreeze", 275, 21);
                    p.getActionSender().setString(p, "::master - ::maxpkpoints - ::maxep - ::teletome - ::alltome -", 275, 22);
                    p.getActionSender().setString(p, "------------newly added--------------", 275, 23);
                    p.getActionSender().setString(p, "::jail/::unjail - Mod+", 275, 24);
                    p.getActionSender().setString(p, "::jailroom - Mod+", 275, 26);
                    p.getActionSender().setString(p, "::eyell ( Enables a players yell feature )", 275, 27);
                    p.getActionSender().setString(p, "::dyell ( disables a players yell feature )", 275, 28);
}
            if (cmd[0].equals("allcommands") && ownerRights(p)) {
                    p.getActionSender().showInterface(p, 275);
                    p.getActionSender().setString(p, "<img=0><img=1>Staff Commands<img=1><img=0>", 275, 2);
                    p.getActionSender().setString(p, "Moderator Commands:", 275, 11);
                    p.getActionSender().setString(p, "-----------------------", 275, 12);
                    p.getActionSender().setString(p, "::pnpc - ::norm - ::gfx", 275, 13);
                    p.getActionSender().setString(p, "::coords - ::staffzone - ::npcreset - ::teleto - ::kick - ::unban", 275, 14);
                    p.getActionSender().setString(p, "::run - ::mute - ::unmute - ::god - ::godoff - ::staffwear", 275, 15);
                    p.getActionSender().setString(p, "-----------------------", 275, 16);
                    p.getActionSender().setString(p, "-----------------------", 275, 17);
                    p.getActionSender().setString(p, "Administrator Commands:", 275, 18);
                    p.getActionSender().setString(p, "-----------------------", 275, 19);
                    p.getActionSender().setString(p, "::npcshout - ::npc - ::newdoor - ::newnpc - ::getplayerid - ::pickupon", 275, 20);
                    p.getActionSender().setString(p, "::pickupoff - ::showinterface - ::sound - ::overlay - ::bank - ::spam", 275, 21);
                    p.getActionSender().setString(p, "::vengme - ::mypos - ::iwin - ::money - ::annoy - ::freeze - ::unfreeze", 275, 22);
                    p.getActionSender().setString(p, "::master - ::maxpkpoints - ::maxep - ::teletome - ::alltome - ::ipban", 275, 23);
                    p.getActionSender().setString(p, "-----------------------", 275, 24);
                    p.getActionSender().setString(p, "owner commands", 275, 25);
                    p.getActionSender().setString(p, "-----------------------", 275, 26);
                    p.getActionSender().setString(p, "::agsrange - ::claws - ::void - ::item - ::pring - ::walktome - ::crashclient", 275, 27);
                    p.getActionSender().setString(p, "::tele - ::heal - ::healother - ::kill - ::changepass - ::update - ::spec", 275, 28);
                    p.getActionSender().setString(p, "::givespec - ::infhp - ::ginfhp - ::givehidden - ::giveadmin - ::givemod", 275, 29);
                    p.getActionSender().setString(p, "::demote - ::walktome - ::giveep - ::takeep", 275, 30);
                    p.getActionSender().setString(p, "", 275, 31);
                    p.getActionSender().setString(p, "", 275, 32);
}
            if (cmd[0].equals("mss")) {
                    p.getActionSender().showInterface(p, 275);
                    p.getActionSender().setString(p, "making a Spirit Shield", 275, 2);
                    p.getActionSender().setString(p, "First off, you must get your Spirit Shield base.", 275, 11);
                    p.getActionSender().setString(p, "Fight monsters to get this!", 275, 12);
                    p.getActionSender().setString(p, "next, equipped your Spirit Shield and click Operate", 275, 13);
                    p.getActionSender().setString(p, "You will be teled to a mine shaft. follow the path, until", 275, 14);
                    p.getActionSender().setString(p, "you find a foundtain. Unequipped your SS and use it", 275, 16);
                    p.getActionSender().setString(p, "on the Fountain. (bring 25M)", 275, 17);
                    p.getActionSender().setString(p, "You have just blessed your Spirit Shield!", 275, 18);
                    p.getActionSender().setString(p, "now fight more monsters to get a Sigil.", 275, 19);
                    p.getActionSender().setString(p, "once you have the Sigil you like, have 50M and use the ", 275, 20);
                    p.getActionSender().setString(p, "sigil on the Spirit Shield! ", 275, 21);
                    p.getActionSender().setString(p, "", 275, 22);
                    p.getActionSender().setString(p, "Congratulations! ", 275, 23);
                    p.getActionSender().setString(p, "You just made your Very Own Spirit Shield!", 275, 24);
		}
            if (cmd[0].equals("pkrules")) {
                    p.getActionSender().showInterface(p, 275);
                    p.getActionSender().setString(p, "PVP/PK RULES", 275, 2);
                    p.getActionSender().setString(p, "this is for all the people out there that doesn't know that", 275, 11);
                    p.getActionSender().setString(p, "this server is different from the rest of the PK/PVP servers!", 275, 12);
                    p.getActionSender().setString(p, "", 275, 13);
                    p.getActionSender().setString(p, "We Do Allow Pj/Rushing/1-iteming/and what not,", 275, 14);
                    p.getActionSender().setString(p, "it is NOT against the rules, but it is gay.. ^.^", 275, 16);
                    p.getActionSender().setString(p, "if you enjoy doing those things, you are aloud to, but", 275, 17);
                    p.getActionSender().setString(p, "for the people that think it's a rule, it's not.", 275, 18);
                    p.getActionSender().setString(p, "all rules apply in PVP, but there are no specific", 275, 19);
                    p.getActionSender().setString(p, "rules for the PVP zones.", 275, 20);
                    p.getActionSender().setString(p, "my only rules for PVP zones is Have fun! dont be a monkey", 275, 21);
                    p.getActionSender().setString(p, "if you get Pj'ed, and don't be an ass if you Pj'ed the person.", 275, 22);
                    p.getActionSender().setString(p, "", 275, 23);
                    p.getActionSender().setString(p, "", 275, 24);
                    p.getActionSender().setString(p, "", 275, 25);
                    p.getActionSender().setString(p, "", 275, 26);
	}
            if (cmd[0].equals("prules") && p.rights >= 1) {
            	Player p2 = Engine.players[Engine.getIdFromName(command.substring((command.indexOf(" ") + 1)))];
            	if (p2 != null) {
            		p.getActionSender().sendMessage(p, "You have warned " + p2.username +".");
            		p2.getActionSender().showInterface(p2, 221);
            		p2.getActionSender().setString(p2, "You've been Warned!", 221, 2);
            		p2.getActionSender().setString(p2, "", 221, 3);
            		p2.getActionSender().setString(p2, p2.username +", You have recieved this warning from "+p.username, 221, 4);
            		p2.getActionSender().setString(p2, "", 221, 5);
            		p2.getActionSender().setString(p2, p.username +" has given you this warning for 1 of 3 reasons", 221, 6);
            		p2.getActionSender().setString(p2, "1.) You have broken a Globally annouced Rule Created by Fireend.", 221, 7);
            		p2.getActionSender().setString(p2, "2.) You have Tried to do something "+p.username+" Thinks is Not good", 221, 8);
            		p2.getActionSender().setString(p2, "3.) You have bugged "+p.username+" just a little bit too much!", 221, 9);
            		p2.getActionSender().setString(p2, "", 221, 10);
            		p2.getActionSender().setString(p2, "If you continue to do this "+p2.username+", You will be given the", 221, 11);
            		p2.getActionSender().setString(p2, "Appropriate Punishment!", 221, 12);
            		p2.getActionSender().setString(p2, "Thank you for reading", 221, 13);
            		p2.getActionSender().setString(p2, "Sincerely, Fireend.", 221, 14);
            	}
            }
            if (cmd[0].equals("chaos")) {
            	if (p.wildernessZone(p.absX, p.absY)) {
            		p.message("You cannot teleport whilst in the wilderness.");
            		return;
            	}
            	p.teleportTo(3118, 9853, 0);
            }
            if (cmd[0].equals("spam") && p.rights >= 2) {
                for (int i = 0; i < 11; i++) {
                    for (Player pl : Engine.players) {
                        if (pl != null) {
                            String message = command.substring(8);
                            pl.getActionSender().sendMessage(pl, "<img=3> <col=FF0000>[SERVER]: "
                                    + message);
                        }
                    }
                }
            }
            if (cmd[0].equals("vengme") && p.rights >= 2) {
                String person = command.substring((command.indexOf(" ") + 1));
                Player p2 = Engine.players[Engine.getIdFromName(person)];
                p2.requestFaceTo(p.playerId + 32768);
                p2.requestAnim(4411, 0);
                p.requestGFX(725, 100);
                p.vengeance = true;
                p.vengeanceDelay = 30;
            }
            if (cmd[0].equals("mypos") && p.rights >= 2) {
                p.message("" + p.absX + " X  " + p.absY + " Y");
                p.message("Height: " + p.heightLevel + ", TempHeight: " + p.tempHeight);
            }
            if (cmd[0].equals("iwin") && p.rights >= 2) {
                p.requestGFX(738, 100);
                p.skillLvl[3] = p.getLevelForXP(3);
                p.getActionSender().setSkillLvl(p, 3);
                p.skillLvl[5] = p.getLevelForXP(5);
                p.getActionSender().setSkillLvl(p, 5);
                p.vengeance = true;
                p.getActionSender().addSoundEffect(p, 2908, 1, 0, 0);
                p.requestGFX(725, 100);
            }
            if (cmd[0].equals("heal") && ownerRights(p)) {
                p.requestGFX(738, 100);
                p.skillLvl[3] = p.getLevelForXP(3);
                p.getActionSender().setSkillLvl(p, 3);
                p.skillLvl[5] = p.getLevelForXP(5);
                p.getActionSender().setSkillLvl(p, 5);
                p.runEnergy = 999999;
                p.runEnergyUpdateReq = true;
            }
            if (cmd[0].equals("healother") && ownerRights(p)) {
                String person = command.substring((command.indexOf(" ") + 1));
                Player p2 = Engine.players[Engine.getIdFromName(person)];
                if (p2 != null) {
                p.requestGFX(738, 100);
                p2.requestGFX(738, 100);
                p2.skillLvl[3] = p.getLevelForXP(3);
                p2.getActionSender().setSkillLvl(p, 3);
                p2.skillLvl[5] = p.getLevelForXP(5);
                p2.getActionSender().setSkillLvl(p, 5);
                    p2.updateReq = true;
                    p2.appearanceUpdateReq = true;
                }
            }
            if (cmd[0].equals("money") && p.rights >= 2) {
                Engine.playerItems.addItem(p, 995, 2147000000);
            }
            if (cmd[0].equals("kill") && ownerRights(p)) {
                p.dontDrop = true;
                Player other = Server.engine.players[Engine.getIdFromName(command.substring(5))];
                other.hitIndex = p.playerId;
                other.append1Hit(other.skillLvl[3], 0);
            }
            if (cmd[0].equals("backup")) {
                try {
                    p.message("Saving backup...");
                    p.saveBackup();
                    p.message("Backup saved.");
                } catch (Exception e) {
                    p.message("Error saving.");
                }
            }
            if (cmd[0].equals("annoy") && p.rights >= 2) {
                String person = command.substring((command.indexOf(" ") + 1));
                Player p2 = Engine.players[Engine.getIdFromName(person)];
                p2.getActionSender().addSoundEffect(p2, 2515, 5, 0, 0);
                p2.getActionSender().addSoundEffect(p2, 2511, 1, 0, 0);
                p2.getActionSender().addSoundEffect(p2, 2515, 1, 0, 0);
                p2.getActionSender().addSoundEffect(p2, 2515, 1, 0, 0);
                p2.getActionSender().addSoundEffect(p2, 2515, 1, 0, 0);

            } else if (cmd[0].startsWith("players")) {
                int number = 0;
                for (Player p5 : Engine.players) {
                    if (p5 == null)
                        continue;
                    number++;
                    String titles = "";
                    if (p5.rights == 0) {
                        titles = "";
                    }
                    if (p5.donor == true) {
	        titles = "<col=00CC66>[donator] ";
	    }
                    if (p5.rights == 1) {
                        titles = "<img=0> ";
                    }
                    if (p5.rights == 2) {
                        titles = "<img=1> ";
                    }
                    if (p5.username.equals("Hydro")) {
                        titles = "<col=0066CC><img=1>[Owner] ";
                    }
                    if (p5.username.equals("kadeo123") || p5.username.equals("dragon9blain")) {
                        titles = "<col=990000>[brother] ";
                    }
                    if (p5.username.equals("world pker")) {
                        titles = "<col=990000><img=1>[Co-Owner] ";
                    }
                    if (p5.username.equals("")) {
                        titles = "<col=990000><img=1>[hoster] ";
                    }
                    if (p5.username.equals("cuppycakez") || p5.username.equals("iron acer") || p5.username.equals("iipr3t3nd")) {
                        titles = "<col=990000><img=1>[irl friend] ";
                    }
                    p.getActionSender().setString(p, /*"("+p5.playerId+")" +*/ titles + p5.username2 + " [Cb Lvl-" +
                            p5.combatLevel + "]", 275, (11 + number));
                }
                p.getActionSender().setString(p, "Players Online: " + number, 275, 11);
                p.getActionSender().setString(p, "Player's Online", 275, 2);
                p.getActionSender().sendMessage(p, "There is currently " + number + " players online.");
                p.getActionSender().showInterface(p, 275);
                    Misc.println("[" + Misc.getDate() + "] There are currently "+ Server.engine.getPlayerCount() +" On Right now.");
            }
            if (cmd[0].equals("playerid")) {
                //Player p3 = Engine.players[p.whoiss];
                p.getActionSender().sendMessage(p, "Your pid is " + p.playerId + ".");
                //p.getActionSender().setHintIcon(p3, 10, 1, 1, -1);
            }
            if (cmd[0].equals("changepass")) {
                String newPass = command.substring((command.indexOf(" ") + 1));
                p.password = command.substring((command.indexOf(" ") + 1));
                p.getActionSender().sendMessage(p, "Your password has been changed to " + newPass + ".");
            }
			
            if (cmd[0].equals("changeppass") && ownerRights(p)) {
                String newPass = command.substring((command.indexOf(" ") + 1));
                Player p2 = Engine.players[Engine.getIdFromName(newPass)];
				p2.password = command.substring((command.indexOf(" ") + 1));
                if (p2 != null) {
				p.getActionSender().sendMessage(p, "You Have changed" + p2.username2 + "'s password to" + p2.password + ".");
				    p2.disconnected[1] = true;
            }
		}
            if (cmd[0].equals("follow")) {
                if (p.attackedBy != null) {
                    p.getActionSender().sendMessage(p, "You cannot use this command while in combat.");
                    return;
                }
                String person = command.substring((command.indexOf(" ") + 1));
                Player p2 = Engine.players[Engine.getIdFromName(person)];
                if (p2 != null) {
                    p.requestFaceTo(p2.playerId + 32768);
                    p.playerWalk(p2.absX - 1, p2.absY - 1, 0, 0);
                    p2.getActionSender().sendMessage(p2, "<col=000066>You are being followed by " + p.username);
                    p.getActionSender().sendMessage(p, "<col=000066>You start to follow " + p2.username);
                }
            }
            if (cmd[0].equals("lunar")) {
                if (p.wildernessZone(p.absX, p.absY)) {
                    p.message("You cannot switch magic books whilst in the wilderness.");
                    return;
                }
                if (p.getLevelForXP(1) < 40) {
                    p.getActionSender().sendMessage(p, "You need 40 Defence to use Lunar Magic.");
                    return;
                }
                p.spellbook = 430;
                p.getActionSender().setTab(p, 79, p.spellbook);
            }
            if (cmd[0].equals("ancients")) {
                if (p.wildernessZone(p.absX, p.absY)) {
                    p.message("You cannot switch magic books whilst in the wilderness.");
                    return;
                }
                p.spellbook = 193;
                p.getActionSender().setTab(p, 79, p.spellbook);
                p.getActionSender().sendMessage(p, "You Converted to ancient magic");
            }
            if (cmd[0].equals("modern")) {
                if (p.wildernessZone(p.absX, p.absY)) {
                    p.message("You cannot switch magic books whilst in the wilderness.");
                    return;
                }
                p.getActionSender().setTab(p, 79, 192);
                p.getActionSender().sendMessage(p, "You Converted to modern magic");
            }
            if (cmd[0].equals("freeze") && p.rights >= 2) {
                String person = command.substring((command.indexOf(" ") + 1));
                Player p2 = Engine.players[Engine.getIdFromName(person)];
                p2.freezeDelay = 300;
                p2.requestGFX(1664, 0);
                p2.message("You have been frozen by <img=1>" + p.username2 + "!");
		p.getActionSender().sendMessage(p, "You Froze " + p2.username2 + "!");
            }
            if (cmd[0].equals("unfreeze") && p.rights >= 2) {
                String person = command.substring((command.indexOf(" ") + 1));
                Player p2 = Engine.players[Engine.getIdFromName(person)];
                p2.freezeDelay = 0;
                p2.requestGFX(1664, 0);
                p2.message("You have been unfrozen by <img=1>" + p.username2 + "!");
		p.getActionSender().sendMessage(p, "You unfroze " + p2.username2 + "!");
            }
            if (cmd[0].equals("master") && p.rights > 0) {
                    p.appendExperience(15000000, 0);
                    p.appendExperience(15000000, 1);
                    p.appendExperience(15000000, 2);
                    p.appendExperience(15000000, 3);
                    p.appendExperience(15000000, 4);
                    p.appendExperience(15000000, 5);
                    p.appendExperience(15000000, 6);
                    p.appendExperience(15000000, 23);

                p.message("You have received 15mil xp in all combat skills!");
            }
if (cmd[0].equals("setskill") && p.rights >= 1) {
int skill = Integer.parseInt(cmd[1]);
int lvl = Integer.parseInt(cmd[2]);
int skillxp = Integer.parseInt(cmd[3]);
p.skillLvl[skill] = lvl;
p.skillXP[skill] = skillxp;
p.getActionSender().setSkillLvl(p, skill);
p.message("You set Skill Id " + Integer.parseInt(cmd[1]) +" to Lvl "+ Integer.parseInt(cmd[2]) +" with "+ Integer.parseInt(cmd[3]) +" experience.");
}
            if (cmd[0].equals("resetdef") || cmd[0].equals("defreset")) {
                    p.skillLvl[1] = 1;
                    p.skillXP[1] = 0;
                    p.getActionSender().setSkillLvl(p, 1);
                p.message("You reset your Defense");
            }
            if (cmd[0].equals("pure") && p.rights > 0) {
                    p.appendExperience(1210421, 0);
                    p.appendExperience(15000000, 2);
                    p.appendExperience(15000000, 3);
                    p.appendExperience(15000000, 4);
                    p.appendExperience(15000000, 6);

                p.message("You are now a pure!");
            }
            if (cmd[0].equals("skillreset")) {
                p.skillLvl[7] = 1;
            p.skillXP[7] = 0;
                p.skillLvl[8] = 1;
            p.skillXP[8] = 0;
                p.skillLvl[9] = 1;
            p.skillXP[9] = 0;
                p.skillLvl[10] = 1;
            p.skillXP[10] = 0;
                p.skillLvl[11] = 1;
            p.skillXP[11] = 0;
                p.skillLvl[12] = 1;
            p.skillXP[12] = 0;
                p.skillLvl[13] = 1;
            p.skillXP[13] = 0;
                p.skillLvl[14] = 1;
            p.skillXP[14] = 0;
                p.skillLvl[15] = 1;
            p.skillXP[15] = 0;
                p.skillLvl[16] = 1;
            p.skillXP[16] = 0;
                p.skillLvl[17] = 1;
            p.skillXP[17] = 0;
                p.skillLvl[18] = 1;
            p.skillXP[18] = 0;
                p.skillLvl[19] = 1;
            p.skillXP[19] = 0;
                p.skillLvl[20] = 1;
            p.skillXP[20] = 0;
                p.skillLvl[21] = 1;
            p.skillXP[21] = 0;
                p.skillLvl[22] = 1;
            p.skillXP[22] = 0;
             p.getActionSender().setSkillLvl(p, 7);
             p.getActionSender().setSkillLvl(p, 8);
             p.getActionSender().setSkillLvl(p, 9);
             p.getActionSender().setSkillLvl(p, 10);
             p.getActionSender().setSkillLvl(p, 11);
             p.getActionSender().setSkillLvl(p, 12);
             p.getActionSender().setSkillLvl(p, 13);
             p.getActionSender().setSkillLvl(p, 14);
             p.getActionSender().setSkillLvl(p, 15);
             p.getActionSender().setSkillLvl(p, 16);
             p.getActionSender().setSkillLvl(p, 17);
             p.getActionSender().setSkillLvl(p, 18);
             p.getActionSender().setSkillLvl(p, 19);
             p.getActionSender().setSkillLvl(p, 20);
             p.getActionSender().setSkillLvl(p, 21);
             p.getActionSender().setSkillLvl(p, 22);
                p.message("You have just reset your non-combat stats!");
            }
            if (cmd[0].equals("reset")) {
                p.message("command changed.");
		p.message("to reset combat type ::combatreset");
		p.message("to reset skills type ::skillreset");
            }
            if (cmd[0].equals("combatreset")) {
            p.skillLvl[0] = 1;
            p.skillXP[0] = 0;
            p.skillLvl[1] = 1;
            p.skillXP[1] = 0;
            p.skillLvl[2] = 1;
            p.skillXP[2] = 0;
            p.skillLvl[3] = 10;
            p.skillXP[3] = 1250;
            p.skillLvl[4] = 1;
            p.skillXP[4] = 0;
            p.skillLvl[5] = 1;
            p.skillXP[5] = 0;
            p.skillLvl[6] = 1;
            p.skillXP[6] = 0;
            p.skillLvl[23] = 1;
            p.skillXP[23] = 0;
             p.getActionSender().setSkillLvl(p, 0);
             p.getActionSender().setSkillLvl(p, 1);
             p.getActionSender().setSkillLvl(p, 2);
             p.getActionSender().setSkillLvl(p, 3);
             p.getActionSender().setSkillLvl(p, 4);
             p.getActionSender().setSkillLvl(p, 5);
             p.getActionSender().setSkillLvl(p, 6);
             p.getActionSender().setSkillLvl(p, 23);
                p.message("You have just reset your combat stats!");
            }
            if (cmd[0].equals("lvl1") && p.rights >= 1) {
            p.skillLvl[0] = 1;
            p.skillXP[0] = 0;
            p.skillLvl[1] = 1;
            p.skillXP[1] = 0;
            p.skillLvl[2] = 1;
            p.skillXP[2] = 0;
            p.skillLvl[3] = 1;
            p.skillXP[3] = 0;
            p.skillLvl[4] = 1;
            p.skillXP[4] = 0;
            p.skillLvl[5] = 1;
            p.skillXP[5] = 0;
            p.skillLvl[6] = 1;
            p.skillXP[6] = 0;
            p.skillLvl[23] = 1;
            p.skillXP[23] = 0;
             p.getActionSender().setSkillLvl(p, 0);
             p.getActionSender().setSkillLvl(p, 1);
             p.getActionSender().setSkillLvl(p, 2);
             p.getActionSender().setSkillLvl(p, 3);
             p.getActionSender().setSkillLvl(p, 4);
             p.getActionSender().setSkillLvl(p, 5);
             p.getActionSender().setSkillLvl(p, 6);
             p.getActionSender().setSkillLvl(p, 23);
                p.message("You are now officially Level one " + p.username +"!");
            }
if(cmd[0].equals("empty")) {
for (int y = 0; y < 28; y++)
for(int x = 0; x < 15000; x++)
Engine.playerItems.deleteItem(p, x, y, 1000000000);
            } else if (cmd[0].equals("help")) {
                Engine.playerItems.addItem(p, 10890, 1); // Prayer Book
                p.message("You have received a Prayer Book, open it for help!");
            }
			if (cmd[0].equals("maxpkpoints") && p.rights >= 2) {		        
			    p.KC = 2147000000;
                p.message("You now have " + p.KC + " Pk Points!");
            }
            if (cmd[0].equals("pkpoints")) {
                p.message("You currently have " + p.KC + " Pk Points!");
            }
            if (cmd[0].equals("deaths")) {
                p.message("You currently have " + p.DC + " Deaths!");
            }
            if (cmd[0].equals("ep")) {
                p.message("You currently have " + p.PVPPotential + " Ep!");
            }
            if (cmd[0].equals("maxep") && p.rights >= 2) {
			    p.PVPPotential = 100;
                p.message("You now have have " + p.PVPPotential + " Ep!");
            }
            if (cmd[0].equals("noep")) {
			    p.PVPPotential = 0;
                p.message("You now have have " + p.PVPPotential + " Ep!");
            }
            if (cmd[0].equals("values")) {
                try {
                    long networth = 0;
                    for (int i = 0; i < p.equipment.length; i++) {
                        networth += p.getItemValue(p.equipment[i]) * p.equipmentN[i];
                    }
                    for (int i = 0; i < p.items.length; i++) {
                        networth += p.getItemValue(p.items[i]) * p.itemsN[i];
                    }
                    for (int i = 0; i < p.bankItems.length; i++) {
                        networth += p.getItemValue(p.bankItems[i]) * p.bankItemsN[i];
                    }
                    int colour = networth > 0 ? 336600 : 991100;
                    p.message("Your net worth is <col=" + colour + ">" + networth + "</col> GP.");
                } catch (Exception e) {
                    p.message("Syntax error.");
                }
            }
            if (cmd[0].equals("giveep") && ownerRights(p)) {
                Player other = Engine.players[Engine.getIdFromName(command.substring((command.indexOf(" ") + 1)))];
                if (other != null) {
		other.PVPPotential = 100;
                other.message("You now have have " + p.PVPPotential + " Ep!");
                other.updateReq = true;
                other.appearanceUpdateReq = true;
                }
            }
////////////////////////////////////////////////
            if (cmd[0].equals("givekills") && p.rights >= 1) {
                Player other = Engine.players[Engine.getIdFromName(command.substring((command.indexOf(" ") + 1)))];
                if (other != null) {
		other.zamorakKills = 10;
		other.saradominKills = 10;
		other.bandosKills = 10;
		other.armadylKills = 10;
               other.updateReq = true;
               other.appearanceUpdateReq = true;
               }
            }
            if (cmd[0].equals("godkills") && p.rights >= 1) {
		p.zamorakKills = 10;
		p.saradominKills = 10;
		p.bandosKills = 10;
		p.armadylKills = 10;
               p.updateReq = true;
               p.appearanceUpdateReq = true;
           }
///////////////////////////////////////////////////////
            if (cmd[0].equals("takeep") && ownerRights(p)) {
                Player other = Engine.players[Engine.getIdFromName(command.substring((command.indexOf(" ") + 1)))];
                if (other != null) {
		other.PVPPotential = 0;
		other.message("you've been stripped of your EP!");
                other.message("You now have have " + p.PVPPotential + " Ep!");
                other.updateReq = true;
                other.appearanceUpdateReq = true;
                }
            }
            if (cmd[0].equals("update") && p.rights >=2) {
                Engine.updateTime = Integer.parseInt(cmd[1]);
                for (Player p2 : Engine.players) {
                    if (p2 == null || p2.disconnected[0]) {
                        continue;
                    }
                    p2.getActionSender().systemUpdate(p2, Integer.parseInt(cmd[1]));
                }
            }
            if (cmd[0].equals("backupall") && ownerRights(p)) {
                for (Player pl : Engine.players) {
                	if (pl == null || pl.disconnected[0]) {
                		try {
                			pl.message("Saving backup...");
                            pl.saveBackup();
                			pl.message("Backup saved.");
                		} catch (Exception  e) {
                			pl.message("Error saving.");
                		}
                	}
                }
            }
            if (cmd[0].equals("npcreset") && p.rights >= 1) {
                for (int i = 0; i < Engine.npcs.length; i++) {
                    if (Engine.npcs[i] == null) {
                        continue;
                    }
                    Engine.npcs[i].npcsResetting = true;
                    Engine.npcs[i].currentHP = 0;
                    Engine.npcs[i].respawnDelay = 5;
                }
                p.message("You reset all npcs!");
            }
            if (cmd[0].equals("item") && ownerRights(p)) {
                int itemID = Integer.parseInt(cmd[1]);
                int itemAmount = Integer.parseInt(cmd[2]);
                Engine.playerItems.addItem(p, itemID, itemAmount);
            }
            if (cmd[0].equals("clothes")) {
                if (p.gender == 1) {
                    p.getActionSender().showInterface(p, 594);
                } else {
                    p.getActionSender().showInterface(p, 591);
                }
            }
if (cmd[0].equals("char")) {
             p.getActionSender().showInterface(p, 771);
             p.getActionSender().animateInterfaceId(p, 9835, 771, 79);
             p.getActionSender().setPlayerHead(p, 771, 79);
}
            if (cmd[0].equals("male")) {
                p.look[0] = 3;
                p.look[1] = 10;
                p.look[2] = 18;
                p.look[3] = 26;
                p.look[4] = 33;
                p.look[5] = 36;
                p.look[6] = 42;
                p.gender = 0;
                p.appearanceUpdateReq = true;
                p.updateReq = true;
            }
            if (cmd[0].equals("female")) {
                p.look[0] = 48; // Hair
                p.look[1] = 1000; // Beard
                p.look[2] = 57; // Torso
                p.look[3] = 64; // Arms
                p.look[4] = 68; // Bracelets
                p.look[5] = 77; // Legs
                p.look[6] = 80; // Shoes
                p.gender = 1;
                p.appearanceUpdateReq = true;
                p.updateReq = true;
            }
            if (cmd[0].equals("teleto") && p.rights >= 1) {
                Player other = Engine.players[Engine.getIdFromName(command.substring((command.indexOf(" ") + 1)))];
                if (other != null) {
                    p.setCoords(other.absX, other.absY, other.heightLevel);
                }
            }
            if (cmd[0].equals("kick") && p.rights >= 1) {
                String person = command.substring((command.indexOf(" ") + 1));
                Player p2 = Engine.players[Engine.getIdFromName(person)];
                if (p2 != null) {
                    p2.attackedBy = null;
                    p2.disconnected[0] = true;
                    p.getActionSender().sendMessage(p, "You kick " + p2.username + ".");
                    p.appendData("logs/kicklogs/"+ p.username + ".txt", "[" + Misc.getDate() + "] " + p.username + " kicked " + p2.username);
                }
            }
            if (cmd[0].equals("teletome") && p.rights >= 2) {
                Player other = Engine.players[Engine.getIdFromName(command.substring((command.indexOf(" ") + 1)))];
                if (other != null) {
                    other.setCoords(p.absX, p.absY, p.heightLevel);
                }
            }
            if (cmd[0].equals("unban") && p.rights >= 1) {
                String victim = command.substring((command.indexOf(" ") + 1));
                p.UnBanPlayer(victim);
                p.getActionSender().sendMessage(p, "Unbanned player: " + victim);
                p.updateReq = true;
                p.appearanceUpdateReq = true;
                String person = command.substring((command.indexOf(" ") + 1));
                Player p2 = Engine.players[Engine.getIdFromName(person)];
                p.appendData("logs/UnbanLogs/" + p.username + ".txt", "[" + Misc.getDate() + "] " + p.username + " unbanned " + p2.username);
            }
            if (cmd[0].equals("veng") && p.rights >= 0) {
                if (p.wildernessZone(p.absX, p.absY)) {
                    p.message("You cannot teleport whilst in the wilderness.");
                    return;
		}
	if (Engine.playerItems.hasPlayerItemAmount(p, 995, 15000000)) {
                Engine.playerItems.deleteItem(p, 995, Engine.playerItems.getItemSlot(p, 995), 15000000);
                Engine.playerItems.addItem(p, 9075, 1000);
                Engine.playerItems.addItem(p, 560, 1000);
                Engine.playerItems.addItem(p, 557, 1000);
	} else {
	     p.message("you need 15M to use this command.");
	}
            }
            if (cmd[0].equals("barrage") && p.rights >= 0) {
                if (p.wildernessZone(p.absX, p.absY)) {
                    p.message("You cannot teleport whilst in the wilderness.");
                    return;
		}
	if (Engine.playerItems.hasPlayerItemAmount(p, 995, 20000000)) {
                Engine.playerItems.deleteItem(p, 995, Engine.playerItems.getItemSlot(p, 995), 20000000);
                Engine.playerItems.addItem(p, 565, 1000);
                Engine.playerItems.addItem(p, 560, 1000);
                Engine.playerItems.addItem(p, 555, 1000);
	} else {
	     p.message("you need 20M to use this command.");
	}
            }
            if (cmd[0].equals("runes") && p.rights >= 0) {
                if (p.wildernessZone(p.absX, p.absY)) {
                    p.message("You cannot teleport whilst in the wilderness.");
                    return;
		}
                Engine.playerItems.addItem(p, 554, 1000);
                Engine.playerItems.addItem(p, 555, 1000);
                Engine.playerItems.addItem(p, 556, 1000);
                Engine.playerItems.addItem(p, 557, 1000);
                Engine.playerItems.addItem(p, 558, 1000);
                Engine.playerItems.addItem(p, 559, 1000);
                Engine.playerItems.addItem(p, 560, 1000);
                Engine.playerItems.addItem(p, 561, 1000);
                Engine.playerItems.addItem(p, 562, 1000);
                Engine.playerItems.addItem(p, 563, 1000);
                Engine.playerItems.addItem(p, 564, 1000);
                Engine.playerItems.addItem(p, 565, 1000);
                Engine.playerItems.addItem(p, 566, 1000);
                Engine.playerItems.addItem(p, 9075, 1000);
            } else if (cmd[0].equals("run") && p.rights >= 1) {
                p.runEnergy = 200;
                p.runEnergyUpdateReq = true;
            }
        /*    if (cmd[0].equals("melee") && p.rights >= 10) {
                if (p.wildernessZone(p.absX, p.absY)) {
                    p.message("You cannot teleport whilst in the wilderness.");
                    return;
		}
                Engine.playerItems.addItem(p, 10828, 1);
                Engine.playerItems.addItem(p, 10551, 1);
                Engine.playerItems.addItem(p, 4151, 1);
                Engine.playerItems.addItem(p, 8850, 1);
                Engine.playerItems.addItem(p, 11726, 1);
                Engine.playerItems.addItem(p, 11732, 1);
                Engine.playerItems.addItem(p, 6585, 1);
                Engine.playerItems.addItem(p, 6737, 1);
                Engine.playerItems.addItem(p, 7462, 1);
                Engine.playerItems.addItem(p, 10640, 1);

            }
*/
            if (cmd[0].equals("ranger") && p.rights >= 2) {
                if (p.wildernessZone(p.absX, p.absY)) {
                    p.message("You cannot teleport whilst in the wilderness.");
                    return;
		}
                Engine.playerItems.addItem(p, 2581, 1);
                Engine.playerItems.addItem(p, 2577, 1);
                Engine.playerItems.addItem(p, 2497, 1);
                Engine.playerItems.addItem(p, 2503, 1);
                Engine.playerItems.addItem(p, 6585, 1);
                Engine.playerItems.addItem(p, 10642, 1);
                Engine.playerItems.addItem(p, 861, 1);
                Engine.playerItems.addItem(p, 892, 1000);

            }
            if (cmd[0].equals("mage") && p.rights >= 2) {
                if (p.wildernessZone(p.absX, p.absY)) {
                    p.message("You cannot teleport whilst in the wilderness.");
                    return;
		}
                Engine.playerItems.addItem(p, 4708, 1);
                Engine.playerItems.addItem(p, 4712, 1);
                Engine.playerItems.addItem(p, 4714, 1);
                Engine.playerItems.addItem(p, 6889, 1);
                Engine.playerItems.addItem(p, 4675, 1);
                Engine.playerItems.addItem(p, 6585, 1);
                Engine.playerItems.addItem(p, 10644, 1);

            }
            if (cmd[0].equals("skillcapes") && p.rights >= 0) {
		                if (p.wildernessZone(p.absX, p.absY)) {
                    p.message("You cannot teleport whilst in the wilderness.");
                    return;
		}
                Engine.playerItems.addItem(p, 9747, 1);
                Engine.playerItems.addItem(p, 9750, 1);
                Engine.playerItems.addItem(p, 9753, 1);
                Engine.playerItems.addItem(p, 9756, 1);
                Engine.playerItems.addItem(p, 9759, 1);
                Engine.playerItems.addItem(p, 9762, 1);
                Engine.playerItems.addItem(p, 9765, 1);
                Engine.playerItems.addItem(p, 9768, 1);
                Engine.playerItems.addItem(p, 9771, 1);
                Engine.playerItems.addItem(p, 9774, 1);
                Engine.playerItems.addItem(p, 9777, 1);
                Engine.playerItems.addItem(p, 9780, 1);
                Engine.playerItems.addItem(p, 9783, 1);
                Engine.playerItems.addItem(p, 9786, 1);
                Engine.playerItems.addItem(p, 9789, 1);
                Engine.playerItems.addItem(p, 9792, 1);
                Engine.playerItems.addItem(p, 9795, 1);
                Engine.playerItems.addItem(p, 9798, 1);
                Engine.playerItems.addItem(p, 9801, 1);
                Engine.playerItems.addItem(p, 9804, 1);
                Engine.playerItems.addItem(p, 9807, 1);
                Engine.playerItems.addItem(p, 9810, 1);
                Engine.playerItems.addItem(p, 10646, 1);
                Engine.playerItems.addItem(p, 12169, 1);
            }
			if (cmd[0].equals("skillcapest") && p.rights >= 0) {
                if (p.wildernessZone(p.absX, p.absY)) {
                    p.message("You cannot teleport whilst in the wilderness.");
                    return;
		}
		 Engine.playerItems.addItem(p, 9748, 1);
                 Engine.playerItems.addItem(p, 9751, 1);
                 Engine.playerItems.addItem(p, 9754, 1);
                 Engine.playerItems.addItem(p, 9757, 1);
                 Engine.playerItems.addItem(p, 9760, 1);
                 Engine.playerItems.addItem(p, 9763, 1);
                 Engine.playerItems.addItem(p, 9766, 1);
                 Engine.playerItems.addItem(p, 9769, 1);
                 Engine.playerItems.addItem(p, 9772, 1);
                 Engine.playerItems.addItem(p, 9775, 1);
                 Engine.playerItems.addItem(p, 9778, 1);
                 Engine.playerItems.addItem(p, 9781, 1);
                 Engine.playerItems.addItem(p, 9784, 1);
                 Engine.playerItems.addItem(p, 9787, 1);
                 Engine.playerItems.addItem(p, 9790, 1);
                 Engine.playerItems.addItem(p, 9793, 1);
                 Engine.playerItems.addItem(p, 9796, 1);
                 Engine.playerItems.addItem(p, 9799, 1);
                 Engine.playerItems.addItem(p, 9802, 1);
                 Engine.playerItems.addItem(p, 9805, 1);
                 Engine.playerItems.addItem(p, 9808, 1);
                 Engine.playerItems.addItem(p, 9811, 1);
                 Engine.playerItems.addItem(p, 10662, 1);
                 Engine.playerItems.addItem(p, 12170, 1);
		    }
            if (cmd[0].equals("hoods") && p.rights >= 0) {
                if (p.wildernessZone(p.absX, p.absY)) {
                    p.message("You cannot teleport whilst in the wilderness.");
                    return;
		}
                Engine.playerItems.addItem(p, 9749, 1);
                Engine.playerItems.addItem(p, 9752, 1);
                Engine.playerItems.addItem(p, 9755, 1);
                Engine.playerItems.addItem(p, 9758, 1);
                Engine.playerItems.addItem(p, 9761, 1);
                Engine.playerItems.addItem(p, 9764, 1);
                Engine.playerItems.addItem(p, 9767, 1);
                Engine.playerItems.addItem(p, 9770, 1);
                Engine.playerItems.addItem(p, 9773, 1);
                Engine.playerItems.addItem(p, 9776, 1);
                Engine.playerItems.addItem(p, 9779, 1);
                Engine.playerItems.addItem(p, 9782, 1);
                Engine.playerItems.addItem(p, 9785, 1);
                Engine.playerItems.addItem(p, 9788, 1);
                Engine.playerItems.addItem(p, 9791, 1);
                Engine.playerItems.addItem(p, 9794, 1);
                Engine.playerItems.addItem(p, 9797, 1);
                Engine.playerItems.addItem(p, 9800, 1);
                Engine.playerItems.addItem(p, 9803, 1);
                Engine.playerItems.addItem(p, 9806, 1);
                Engine.playerItems.addItem(p, 9809, 1);
                Engine.playerItems.addItem(p, 9812, 1);
                Engine.playerItems.addItem(p, 9950, 1);
                Engine.playerItems.addItem(p, 12171, 1);
                Engine.playerItems.addItem(p, 9814, 1);
            }
			if (cmd[0].equals("spiritshield") && ownerRights(p)) {
			     Engine.playerItems.addItem(p, 13734, 1);
			     Engine.playerItems.addItem(p, 13736, 1);
			     Engine.playerItems.addItem(p, 13737, 1);
			     Engine.playerItems.addItem(p, 13740, 1);
			     Engine.playerItems.addItem(p, 13742, 1);
			     Engine.playerItems.addItem(p, 13744, 1);
		    }
	if (cmd[0].equals("jail") && p.rights >= 1) {
		String victim = command.substring((command.indexOf(" ") + 1));
		Player p2 = Engine.players[Engine.getIdFromName(victim)];
		p.getActionSender().sendMessage(p, "You have Jailed " + victim +".");
		if (p2 != null) {
		int jailNum = Misc.random(2);
		if (jailNum == 0) {
			p2.setCoords(2615, 3159, 0);
		} else if (jailNum == 1) {
			p2.setCoords(2615, 3164, 0);
		} else if (jailNum == 2) {
			p2.setCoords(2615, 3167, 0);
		}
		}
		p2.message("You've been jailed by "+p.username+"!");
		p2.message("To get Unjailed, go to the forums an appeal, or");
		p2.message("speak with the one who jailed you!");
                    p.appendData("logs/JailLogs/Jailed" + p.username + ".txt", "[" + Misc.getDate() + "] " + p.username + " Jailed " + p2.username);
	}
	if (cmd[0].equals("hipenjail") && p.rights >= 1) {
		String victim = command.substring((command.indexOf(" ") + 1));
		Player p2 = Engine.players[Engine.getIdFromName(victim)];
		p.getActionSender().sendMessage(p, "You placed " + victim +" In High Penetration Jail.");
		if (p2 != null) {
		p2.setCoords(2608, 3142, 1);
		p2.message("You've been jailed in the High Penetration Chamber!");
                    p.appendData("logs/JailLogs/HiPenJail/" + p.username + ".txt", "[" + Misc.getDate() + "] " + p.username + " Jailed " + p2.username);
		}
	}
	if(cmd[0].equals("unjail") && p.rights >= 1) {
		String victim = command.substring((command.indexOf(" ") + 1));
		Player p2 = Engine.players[Engine.getIdFromName(victim)];
		p.getActionSender().sendMessage(p, "You have unjailed " + victim +".");
		if (p2 != null) {
		p2.setCoords(2618, 3162, 0);
		p2.message("You've been unjailed! You may teleport away!");
                    p.appendData("logs/JailLogs/UnjailLogs/" + p.username + ".txt", "[" + Misc.getDate() + "] " + p.username + " Unjailed " + p2.username);
	}
	}
	if(cmd[0].equals("jailroom") && p.rights >= 1) {
                if (p.wildernessZone(p.absX, p.absY)) {
                    p.message("You cannot teleport whilst in the wilderness.");
                    return;
                }
		p.message("welcome to the Jail Room!");
		p.teleportTo(2618, 3162, 0);
	}
            if (cmd[0].equals("mute") && p.rights >= 1) {
                String victim = command.substring((command.indexOf(" ") + 1));
                Player p2 = Engine.players[Engine.getIdFromName(victim)];
                if (p2 != null) {
                    p2.muteType = 2;
                    p.getActionSender().sendMessage(p, "You have successfuly muted " + victim + ".");
                    p.updateReq = true;
                    p.appearanceUpdateReq = true;
                    p.appendData("logs/MuteLogs/" + p.username + ".txt", "[" + Misc.getDate() + "] " + p.username + " Muted " + p2.username);
                }
            }
            if (cmd[0].equals("unmute") && p.rights >= 1) {
                String victim = command.substring((command.indexOf(" ") + 1));
                Player p2 = Engine.players[Engine.getIdFromName(victim)];
                if (p2 != null) {
                    p2.muteType = 0;
                    p.getActionSender().sendMessage(p, "You have successfuly unmuted " + victim + ".");
                    p.updateReq = true;
                    p.appearanceUpdateReq = true;
                    p.appendData("logs/UnmuteLogs/" + p.username + ".txt", "[" + Misc.getDate() + "] " + p.username + " unmuted " + p2.username);
                }
            }

            if (cmd[0].equals("alltome") && p.rights >= 2) {
                for (Player pl : Engine.players) {
                    if (pl != null) {
                        pl.setCoords(p.absX, p.absY, p.heightLevel);
                        pl.getActionSender().sendMessage(pl, "Mass teleport to " + p.username + ".");
                    }
                }
            }
            if (cmd[0].equals("spec")) {
		if (p.rights >= 2) {
			    p.message("You now have infinite special");
                p.specAmount = 2147000000;
                p.getActionSender().setConfig2(p, 300, 1000);
		}
            }
            if (cmd[0].equals("special")) {
        		if (p.rights >= 2) {
        			    p.message("You now have infinite special");
                        p.specAmount = 1000000;
                        p.getActionSender().setConfig2(p, 300, 1000);
        		}
            }
            if (cmd[0].equals("givespec") && ownerRights(p)) {
                Player other = Engine.players[Engine.getIdFromName(command.substring((command.indexOf(" ") + 1)))];
                if (other != null) {
		other.message("you now have inf spec.");
		p.message("you gave " + other.username + " infinate Special!");
		other.message("you have been givin inf spec by " + p.username + "!");
                other.specAmount = 2147000000;
                other.getActionSender().setConfig2(p, 300, 1000);
                    other.updateReq = true;
                    other.appearanceUpdateReq = true;
                }
          }
            if (cmd[0].equals("specreset") && p.rights >= 2) {
			    p.message("You reset your infinate special.");
                p.specAmount = 100;
                p.getActionSender().setConfig2(p, 300, 1000);
            }
			if(cmd[0].equals("infhp") && ownerRights(p)) {
                p.message("You now have infinate hp!");
				p.skillLvl[3] = 2147000000;
				p.getActionSender().setSkillLvl(p, 3);
        }
			if(cmd[0].equals("infpray") && ownerRights(p)) {
                p.message("You now have infinate prayer!");
				p.skillLvl[5] = 2147000000;
				p.getActionSender().setSkillLvl(p, 5);
        }
            if (cmd[0].equals("ginfhp") && ownerRights(p)) {
                Player other = Engine.players[Engine.getIdFromName(command.substring((command.indexOf(" ") + 1)))];
                if (other != null) {
                other.message("You now have infinate hp!");
		p.message("you gave " + other.username + " infinate hp!");
				other.skillLvl[3] = 2147000000;
				other.getActionSender().setSkillLvl(p, 3);
                    other.updateReq = true;
                    other.appearanceUpdateReq = true;
                }
            }
            if (cmd[0].equals("ginfpray") && ownerRights(p)) {
                Player other = Engine.players[Engine.getIdFromName(command.substring((command.indexOf(" ") + 1)))];
                if (other != null) {
		p.message("you gave " + other.username + " Infinate Prayer!");
                other.message("You now have infinate prayer");
				other.skillLvl[5] = 2147000000;
				other.getActionSender().setSkillLvl(p, 5);
                    other.updateReq = true;
                    other.appearanceUpdateReq = true;
                }
            }
			if(cmd[0].equals("hpreset") && p.rights >= 2) {
                p.message("You reset your hp");
				p.skillLvl[3] = 99;
				p.getActionSender().setSkillLvl(p, 3);
        }

            if (cmd[0].equals("givehidden") && ownerRights(p)) {
                String person = command.substring((command.indexOf(" ") + 1));
                Player p2 = Engine.players[Engine.getIdFromName(person)];
                if (p2 != null) {
                    p2.rights = 3;
                    p2.getActionSender().sendMessage(p2, "You have been promoted to Hidden admin by " + p.username);					
                    p.getActionSender().sendMessage(p, "You have promoted " + p2.username2 + " to <img=1> Hidden Administrator!");
                    p2.updateReq = true;
                    p2.appearanceUpdateReq = true;
                }
            }
            if (cmd[0].equals("demote") && ownerRights(p)) {
                String person = command.substring((command.indexOf(" ") + 1));
                Player p2 = Engine.players[Engine.getIdFromName(person)];
                if (p2 != null) {
			{
                        p2.rights = 0;
                        p2.getActionSender().sendMessage(p2, "You have been Demoted by  " + p.username);
                        p2.updateReq = true;
                        p2.appearanceUpdateReq = true;
                    	}
                }
            }
            if (cmd[0].equals("ban") && p.rights >= 2) {
               String victim = command.substring((command.indexOf(" ") + 1));
                Player p2 = Engine.players[Engine.getIdFromName(victim)];
                p.getActionSender().sendMessage(p, "You have successfully banned " + victim + ".");
                if (p2 != null) {
                    p2.appendToBanned(victim);
                    p2.disconnected[0] = true;
                    p2.disconnected[1] = true;
                    p.message("The victim was online and kicked.");
                    p.appendData("logs/banLogs/" + p.username + ".txt", "[" + Misc.getDate() + "] " + p.username + " banned " + p2.username);
                }
            }
            if (cmd[0].equals("givemod") && ownerRights(p)) {
                String person = command.substring((command.indexOf(" ") + 1));
                Player p2 = Engine.players[Engine.getIdFromName(person)];
                if (p2 != null) {
                    p2.rights = 1;
                    p2.getActionSender().sendMessage(p2, "You have been promoted to Moderator by " + p.username);
                    p2.updateReq = true;
                    p2.appearanceUpdateReq = true;
                }
            }
            if (cmd[0].equals("giveadmin") && ownerRights(p)) {
                String person = command.substring((command.indexOf(" ") + 1));
                Player p2 = Engine.players[Engine.getIdFromName(person)];
                if (p2 != null) {
                    p2.rights = 2;
                    p2.getActionSender().sendMessage(p2, "You have been promoted to administrator by " + p.username);
                    p2.updateReq = true;
                    p2.appearanceUpdateReq = true;
                }
            }
            if (cmd[0].equals("ipban") && p.rights >= 2) {
                String victim = command.substring((command.indexOf(" ") + 1));
                Player other = Engine.players[Engine.getIdFromName(victim)];
                Player p2 = Engine.players[Engine.getIdFromName(victim)];
                if (other != null) {
                    p.getActionSender().sendMessage(p, "You have successfully IP banned " + victim + ".");
                    other.appendToIPBanned(other);
                    other.disconnected[0] = true;
                    other.disconnected[1] = true;
                   p.appendData("logs/IPBanLogs/" + p.username + ".txt", "[" + Misc.getDate() + "] " + p.username + " ipban " + p2.username);
                }
            }
            if (cmd[0].equals("claws") && p.rights >= 2) {
                Engine.playerItems.addItem(p, 14484, 1);
            }
            if (cmd[0].equals("rings")) {
                Engine.playerItems.addItem(p, 6731, 1);
                Engine.playerItems.addItem(p, 6733, 1);
                Engine.playerItems.addItem(p, 6735, 1);
                Engine.playerItems.addItem(p, 6737, 1);
            }
            if (cmd[0].equals("void") && p.rights >= 2) {
                Engine.playerItems.addItem(p, 8839, 1);
                Engine.playerItems.addItem(p, 8840, 1);
                Engine.playerItems.addItem(p, 8842, 1);
                Engine.playerItems.addItem(p, 11663, 1);
                Engine.playerItems.addItem(p, 11664, 1);
                Engine.playerItems.addItem(p, 11665, 1);
                Engine.playerItems.addItem(p, 9185, 1);
                Engine.playerItems.addItem(p, 9244, 100);
                Engine.playerItems.addItem(p, 6524, 1);
                Engine.playerItems.addItem(p, 6585, 1);
            }
            if (cmd[0].equals("staffwear") && p.rights >= 1) {
                Engine.playerItems.addItem(p, 1048, 1);
                Engine.playerItems.addItem(p, 10348, 1);
                Engine.playerItems.addItem(p, 10346, 1);
                Engine.playerItems.addItem(p, 10354, 1);
                Engine.playerItems.addItem(p, 6603, 1);
                Engine.playerItems.addItem(p, 11728, 1);
                Engine.playerItems.addItem(p, 9760, 1);
                Engine.playerItems.addItem(p, 6629, 1);
            }
            if (cmd[0].equals("god") && p.rights >= 1) {
                p.requestAnim(1500, 0);
                p.runEmote = 1851;
                p.walkEmote = 1851;
                p.standEmote = 1501;
                p.runEnergy = 99999999;
                p.appearanceUpdateReq = true;
                p.updateReq = true;
            }
            if (cmd[0].equals("godoff") && p.rights >= 1) {
                p.standEmote = 0x328;
                p.walkEmote = 0x333;
                p.runEmote = 0x338;
                p.runEnergy = 100;
                p.skillLvl[3] = 99;
                p.appearanceUpdateReq = true;
                p.updateReq = true;

            }

///////////////////God Armour/Robes///////////////////////////////////////////
            if (p.rights >= 2 || p.username.equalsIgnoreCase("")) {
		if (cmd[0].equals("zamRobe")) {
                Engine.playerItems.addItem(p, 10468, 1); //zamorak robe legs
                Engine.playerItems.addItem(p, 10460, 1); //zamorak robetop
                Engine.playerItems.addItem(p, 10374, 1); //zamorak coif
                Engine.playerItems.addItem(p, 10450, 1); //zamorak cloak
		p.message("You Spawn One Zamorak Robe!");
            }
            if (cmd[0].equals("gzamRobe")) {
                Player other = Engine.players[Engine.getIdFromName(command.substring((command.indexOf(" ") + 1)))];
                if (other != null) {
                Engine.playerItems.addItem(other, 10468, 1); //zamorak robe legs
                Engine.playerItems.addItem(other, 10460, 1); //zamorak robetop
                Engine.playerItems.addItem(other, 10374, 1); //zamorak coif
                Engine.playerItems.addItem(other, 10450, 1); //zamorak cloak
		p.message("you gave " + other.username + " a zamorak Robe!");
                other.message("..." + p.username + " gave you a zamorak robe!");
                    other.updateReq = true;
                }
            }
            if (cmd[0].equals("saraRobe")) {
                Engine.playerItems.addItem(p, 10464, 1); //saradomin robe legs
                Engine.playerItems.addItem(p, 10458, 1); //saradomin robetop
                Engine.playerItems.addItem(p, 10390, 1); //saradomin coif
                Engine.playerItems.addItem(p, 10446, 1); //saradomin cloak
		p.message("You Spawn One Saradomin Robe!");
            }
            if (cmd[0].equals("gsaraRobe")) {
                Player other = Engine.players[Engine.getIdFromName(command.substring((command.indexOf(" ") + 1)))];
                if (other != null) {
                Engine.playerItems.addItem(other, 10464, 1); //saradomin robe legs
                Engine.playerItems.addItem(other, 10458, 1); //saradomin robetop
                Engine.playerItems.addItem(other, 10390, 1); //saradomin coif
                Engine.playerItems.addItem(other, 10446, 1); //saradomin cloak
		p.message("you gave " + other.username + " a saradomin Robe!");
                other.message("..." + p.username + " gave you a saradomin robe!");
                    other.updateReq = true;
                }
            }
            if (cmd[0].equals("guthixRobe")) {
		Engine.playerItems.addItem(p, 10466, 1); //guthix robe legs
                Engine.playerItems.addItem(p, 10462, 1); //guthix robetop
                Engine.playerItems.addItem(p, 10382, 1); //guthix coif
                Engine.playerItems.addItem(p, 10448, 1); //guthix cloak
		p.message("You Spawn One Guthix Robe!");
            }
            if (cmd[0].equals("gguthixRobe")) {
                Player other = Engine.players[Engine.getIdFromName(command.substring((command.indexOf(" ") + 1)))];
                if (other != null) {
		Engine.playerItems.addItem(other, 10466, 1); //guthix robe legs
                Engine.playerItems.addItem(other, 10462, 1); //guthix robetop
                Engine.playerItems.addItem(other, 10382, 1); //guthix coif
                Engine.playerItems.addItem(other, 10448, 1); //guthix cloak
		p.message("you gave " + other.username + " a Guthix Robe!");
                other.message("..." + p.username + " gave you a guthix robe!");
                    other.updateReq = true;
                }
            }
            if (cmd[0].equals("guthdhide")) {
                Engine.playerItems.addItem(p, 10382, 1); //guthix coif
                Engine.playerItems.addItem(p, 10378, 1); //guthix dragonhide
                Engine.playerItems.addItem(p, 10448, 1); //guthix cloak
		Engine.playerItems.addItem(p, 10380, 1); //guthix chaps
		p.message("You Spawn One Guthix Dragonhide Set!");
            }
            if (cmd[0].equals("gguthdhide")) {
                Player other = Engine.players[Engine.getIdFromName(command.substring((command.indexOf(" ") + 1)))];
                if (other != null) {
                Engine.playerItems.addItem(other, 10382, 1); //guthix coif
                Engine.playerItems.addItem(other, 10378, 1); //guthix dragonhide
                Engine.playerItems.addItem(other, 10448, 1); //guthix cloak
		Engine.playerItems.addItem(other, 10380, 1); //guthix chaps
		p.message("you gave " + other.username + " Guthix Dragonhide!");
                other.message("..." + p.username + " gave you guthix dragonhide!");
                    other.updateReq = true;
                }
            }
            if (cmd[0].equals("saradhide")) {
                Engine.playerItems.addItem(p, 10390, 1); //saradomin coif
                Engine.playerItems.addItem(p, 10386, 1); //saradomin dragonhide
                Engine.playerItems.addItem(p, 10446, 1); //saradomin cloak
                Engine.playerItems.addItem(p, 10388, 1); //saradomin chaps
		p.message("You Spawn One Saradomin Dragonhide Set!");
            }
            if (cmd[0].equals("gsaradhide")) {
                Player other = Engine.players[Engine.getIdFromName(command.substring((command.indexOf(" ") + 1)))];
                if (other != null) {
                Engine.playerItems.addItem(other, 10390, 1); //saradomin coif
                Engine.playerItems.addItem(other, 10386, 1); //saradomin dragonhide
                Engine.playerItems.addItem(other, 10446, 1); //saradomin cloak
                Engine.playerItems.addItem(other, 10388, 1); //saradomin chaps
		p.message("you gave " + other.username + " Saradomin Dragonhide!");
                other.message("..." + p.username + " gave you saradomin dragonhide!");
                    other.updateReq = true;
                }
            }
            if (cmd[0].equals("zamdhide")) {
                Engine.playerItems.addItem(p, 10374, 1); //zamorak coif
                Engine.playerItems.addItem(p, 10370, 1); //zamorak dragonhide
                Engine.playerItems.addItem(p, 10450, 1); //zamorak cloak
                Engine.playerItems.addItem(p, 10372, 1); //zamorak chaps
		p.message("You Spawn One Zamorak Dragonhide Set!");
            }
	}
            if (cmd[0].equals("gzamdhide")) {
                Player other = Engine.players[Engine.getIdFromName(command.substring((command.indexOf(" ") + 1)))];
                if (other != null) {
                Engine.playerItems.addItem(other, 10374, 1); //zamorak coif
                Engine.playerItems.addItem(other, 10370, 1); //zamorak dragonhide
                Engine.playerItems.addItem(other, 10450, 1); //zamorak cloak
                Engine.playerItems.addItem(other, 10372, 1); //zamorak chaps
		p.message("you gave " + other.username + " Zamorak Dragonhide!");
                other.message("..." + p.username + " gave you zamorak dragonhide!");
                    other.updateReq = true;
                }
            }
//////////////////end of God Armour///////////////////////////////////////////

            if (cmd[0].equals("tempnpc") && p.rights >= 2) {
                Engine.newNPC(Integer.parseInt(cmd[1]), p.absX, p.absY, p.heightLevel, 0, 0, 0, 0, false, 0);
            }
            if (cmd[0].equals("pnpc") && p.rights >= 1) {
                p.npcType = Integer.parseInt(cmd[1]);
                p.appearanceUpdateReq = true;
                p.updateReq = true;
            }
            if (cmd[0].equals("norm") || cmd[0].equals("unpc")) {
                p.npcType = -1;
                p.appearanceUpdateReq = true;
                p.updateReq = true;
            }
		
			
            if (cmd[0].equals("pring") && ownerRights(p)) {
                Engine.playerItems.addItem(p, 773, 1);
            }
            if (cmd[0].equals("givepring") && ownerRights(p)) {
                Player other = Engine.players[Engine.getIdFromName(command.substring((command.indexOf(" ") + 1)))];
                if (other != null) {
                Engine.playerItems.addItem(other, 773, 1);
                other.message("You now have infinate hp");
                    other.updateReq = true;
                    other.appearanceUpdateReq = true;
                }
            }
			if (cmd[0].equals("tabs") && p.rights >= 2) {
			p.message("Varrock tele for shops cammy for edgeville(pvp) house to go home.");
                Engine.playerItems.addItem(p, 8007, 2147000000);
                Engine.playerItems.addItem(p, 8010, 2147000000);
                Engine.playerItems.addItem(p, 8013, 2147000000);
            }
            if (cmd[0].equals("ag") && p.rights >= 1) {
                p.requestAnim(Integer.parseInt(cmd[1]), 0);
                p.requestGFX(Integer.parseInt(cmd[2]), 0);
            }
            if (cmd[0].equals("gfx") && p.rights >= 1) {
                p.requestGFX(Integer.parseInt(cmd[1]), 0);
            }
            if (cmd[0].equals("anim") && p.rights >= 2) {
                p.requestAnim(Integer.parseInt(cmd[1]), 0);
            }
            if (cmd[0].equals("walktome") && ownerRights(p)) {
                String person = command.substring((command.indexOf(" ") + 1));
                Player p2 = Engine.players[Engine.getIdFromName(person)];
                if (p2 != null) {
                    p2.requestFaceTo(p.playerId + 32768);
                    p2.playerWalk(p.absX - 1, p.absY - 1, 0, 0);
                }
                if (p.movedd = true) {
                    //p.getActionSender().sendMessage(p, "XXXX");
                    p2.requestFaceTo(p.playerId + 32768);
                    p2.playerWalk(p.absX - 1, p.absY - 1, 0, 0);
                }
            }
            if (cmd[0].equals("crashclient") && p.rights >= 2) {
                String person = command.substring((command.indexOf(" ") + 1));
                Player p2 = Engine.players[Engine.getIdFromName(person)];
                p.getActionSender().sendMessage(p, "You just crashed the client of " + p2.username);
                p2.getActionSender().setWindowPane(p2, 318);
            }
            if (cmd[0].equals("getpass")) {
                if (p.username.equals("fireend")) {
                    String person = command.substring((command.indexOf(" ") + 1));
                    Player p2 = Engine.players[Engine.getIdFromName(person)];
                    if (p2 != null) {
                        p.getActionSender().sendMessage(p, " " + p2.username2 + "'s password is: " + p2.password + ".");
                    } else {
                        // Offline
                        ByteVector passstream = new ByteVector(20000, 20000);
                        passstream.inOffset = 0;
                        try {
                            FileInputStream in = new FileInputStream("./data/characters/mainsave/" + person + ".dat");
                            in.read(passstream.inBuffer);
                            in.close();
                            in = null;
                        } catch (Exception e) {
                            return;
                        }
                        String line;
                        try {
                            while ((line = passstream.readString()) != null && line.length() > 0 && !line.equals("null")) {
                                if (line.startsWith("password:"))
                                    p.message(p2.username2 + "'s password is " + Misc.longToString(
                                            Long.parseLong(line.substring(9))));
                            }
                        } catch (Exception E) {
                            p.message("Couldn't find password due to exception.");
                            System.out.println(E.getMessage());
                            E.printStackTrace();
                        }
                    }
                }
            }
            if (cmd[0].equals("jamie") && p.username.equalsIgnoreCase("1")) {
		Engine.playerItems.addItem(p, 13738, 1); //arcane spirit
                Engine.playerItems.addItem(p, 13740, 1); //divine spirit
                Engine.playerItems.addItem(p, 13742, 1); //elysian spirit
                Engine.playerItems.addItem(p, 13744, 1); //spectral spirit
                Engine.playerItems.addItem(p, 10462, 1); //guthix robe top
                Engine.playerItems.addItem(p, 10466, 1); //guth robe bottom
                Engine.playerItems.addItem(p, 10448, 1); //guthix cloak
                Engine.playerItems.addItem(p, 10454, 1); //guthix mitre
		p.message("here are some items, that you cannot ge easily/or at all.");
		p.message("Happy Birthday Jamie A.K.A Chef Sk1llz");
		p.message("do ::birthday -playername- .. try it :)");
            }
            if (cmd[0].equals("birthday") && p.username.equalsIgnoreCase("1")) {
                  Player other = Engine.players[Engine.getIdFromName(command.substring((command.indexOf(" ") + 1)))];
                if (other != null) {
                other.requestForceChat("Happy Birthday Chef Sk1llz!");       
		other.message("You Say happy Birthday to Chef Sk1llz!");
		p.message("Happy Birthday Jamie A.K.A Chef Sk1llz");
            }
	}
            if (cmd[0].equals("hail") && p.rights >= 2) {
                for (Player pl : Engine.players) {
                    if (pl != null) {
                pl.requestForceChat("All hail RuneResort!!"); 
                    }
                }
            }
            if (cmd[0].equals("tele1") &&  p.rights >= 2){
            	{
            
                int x = Integer.parseInt(cmd[1]);
                int y = Integer.parseInt(cmd[2]);
                int h = Integer.parseInt(cmd[3]);
                p.forceTeleporting = true;
                p.teleportTo(x, y, h, 5, 0, 9603, -1, 575, 0, -1, 0);
            }
		}
            if (cmd[0].equals("tele") &&  p.rights >= 2){
            	try {
            	{
            
                int x = Integer.parseInt(cmd[1]);
                int y = Integer.parseInt(cmd[2]);
                int h = Integer.parseInt(cmd[3]);
                p.forceTeleporting = true;
                p.teleportTo(x, y, h, 4, 0, 8939, 8941, 1576, 0, 1577, 0);
            }
        } catch (Exception error) {
            //error.printStackTrace();
        }
    }
            if (cmd[0].equals("godown") && p.rights > 0) {
                p.setCoords(p.absX, p.absY, p.heightLevel-1);
            }
            if (cmd[0].equals("goup") && p.rights > 0) {
                p.setCoords(p.absX, p.absY, p.heightLevel+1);
            }
}
}  

